<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Scriptmatico.Com &#187; PHP</title>
	<atom:link href="http://www.scriptmatico.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptmatico.com</link>
	<description>Blog de tecnologia, programacion, articulos y mas...</description>
	<lastBuildDate>Thu, 01 Apr 2010 00:43:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Video Tutorial : Eliminación de Varios Registros con PHP &amp; MYSQL, usando Checkboxes Parte 2</title>
		<link>http://www.scriptmatico.com/2010/03/31/video-tutorial-eliminacion-de-varios-registros-con-php-mysql-usando-checkboxes-parte-2/</link>
		<comments>http://www.scriptmatico.com/2010/03/31/video-tutorial-eliminacion-de-varios-registros-con-php-mysql-usando-checkboxes-parte-2/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 00:38:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.scriptmatico.com/?p=362</guid>
		<description><![CDATA[Esta es la segunda parte de este video tutorial donde les enseñare a eliminar múltiples registros de la base de datos, en esta segunda parte añadiremos validación con del formulario usando Javascript.
El link al código fuente completo esta mas abajo, este video tutorial esta dividido en dos, ya que Youtube no deja subir vídeos de [...]]]></description>
			<content:encoded><![CDATA[<p>Esta es la segunda parte de este video tutorial donde les enseñare a eliminar múltiples registros de la base de datos, en esta segunda parte añadiremos validación con del formulario usando Javascript.</p>
<p>El link al código fuente completo esta mas abajo, este video tutorial esta dividido en dos, ya que Youtube no deja subir vídeos de mas de 10Mins.</p>
<p>Bien aqui les dejo el Video tutorial, Agradeceria comentarios en youtube o en el blog. Gracias.</p>
<p><a title="Descargar Archivos" href="http://www.scriptmatico.com/wp-content/uploads/2010/03/cursito.zip" target="_blank">Descargar Código Fuente.</a></p>
<p>Parte 1:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="305" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/ST3HpReiV2I&amp;hl=es_ES&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="305" src="http://www.youtube.com/v/ST3HpReiV2I&amp;hl=es_ES&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Parte 2:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="305" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/qZ49JLhRkRY&amp;hl=es_ES&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="305" src="http://www.youtube.com/v/qZ49JLhRkRY&amp;hl=es_ES&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=362&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_362" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Video+Tutorial+%3A+Eliminaci%C3%B3n+de+Varios+Registros+con+PHP+%26+MYSQL%2C+usando+Checkboxes+Parte+2+http://67962.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Video+Tutorial+%3A+Eliminaci%C3%B3n+de+Varios+Registros+con+PHP+%26+MYSQL%2C+usando+Checkboxes+Parte+2+http://67962.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2010/03/31/video-tutorial-eliminacion-de-varios-registros-con-php-mysql-usando-checkboxes-parte-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Video Tutorial : Eliminación de Varios Registros con PHP &amp; MYSQL, usando Checkboxes</title>
		<link>http://www.scriptmatico.com/2010/03/29/video-tutorial-eliminacion-de-varios-registros-con-php-mysql-usando-checkboxes/</link>
		<comments>http://www.scriptmatico.com/2010/03/29/video-tutorial-eliminacion-de-varios-registros-con-php-mysql-usando-checkboxes/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 23:06:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MYSQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutoriales]]></category>

		<guid isPermaLink="false">http://www.scriptmatico.com/?p=354</guid>
		<description><![CDATA[En este video tutorial les enseñare a eliminar múltiples registros de la base de datos, la técnica de programación en muy simple, en esta primera parte del curso les enseñare a hacer la eliminación múltiple y en la segunda parte añadiremos validación con del formulario usando Javascript.
El código fuente completo lo tendrán en la segunda [...]]]></description>
			<content:encoded><![CDATA[<p>En este video tutorial les enseñare a eliminar múltiples registros de la base de datos, la técnica de programación en muy simple, en esta primera parte del curso les enseñare a hacer la eliminación múltiple y en la segunda parte añadiremos validación con del formulario usando Javascript.</p>
<p>El código fuente completo lo tendrán en la segunda parte del curso, este video tutorial esta dividido en dos, ya que Youtube no deja subir vídeos de mas de 10Mins.</p>
<p>Bien aqui les dejo el Video tutorial, Agradeceria comentarios en youtube o en el blog. Gracias.</p>
<p>Parte 1:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="305" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/5uRId3sOPtk&amp;hl=es_ES&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="305" src="http://www.youtube.com/v/5uRId3sOPtk&amp;hl=es_ES&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Parte 2:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="305" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/eDg_sIAgOhM&amp;hl=es_ES&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="305" src="http://www.youtube.com/v/eDg_sIAgOhM&amp;hl=es_ES&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=354&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_354" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Video+Tutorial+%3A+Eliminaci%C3%B3n+de+Varios+Registros+con+PHP+%26+MYSQL%2C+usando+Checkboxes+http://bwn3p.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Video+Tutorial+%3A+Eliminaci%C3%B3n+de+Varios+Registros+con+PHP+%26+MYSQL%2C+usando+Checkboxes+http://bwn3p.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2010/03/29/video-tutorial-eliminacion-de-varios-registros-con-php-mysql-usando-checkboxes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Phpns, Web de Noticias con CMS</title>
		<link>http://www.scriptmatico.com/2010/03/08/phpns-web-de-noticias-con-cms/</link>
		<comments>http://www.scriptmatico.com/2010/03/08/phpns-web-de-noticias-con-cms/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 19:49:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Recursos Web]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.scriptmatico.com/?p=342</guid>
		<description><![CDATA[
Phpns es una aplicación de código abierto en  desarrollada en PHP como Sistema de Noticias que le permitirá diseñar su sitio web de la forma que desee, e incluir un CMS dinámico con una línea de código. Phpns es liberado bajo la licencia GNU GPL, lo que le permite editar, distribuir y compartir la [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.scriptmatico.com/wp-content/uploads/2010/03/article-management.png"><img class="alignnone size-medium wp-image-343" title="phpns CMS Para noticias" src="http://www.scriptmatico.com/wp-content/uploads/2010/03/article-management-300x194.png" alt="" width="300" height="194" /></a></p>
<p>Phpns es una aplicación de código abierto en  desarrollada en PHP como Sistema de Noticias que le permitirá diseñar su sitio web de la forma que desee, e incluir un CMS dinámico con una línea de código. Phpns es liberado bajo la licencia GNU GPL, lo que le permite editar, distribuir y compartir la personalización.</p>
<p>Viene con variables como la adición de la paginación, que figura un resumen o el pleno<br />
de contenido, la generación de RSS y mucho más.</p>
<p>Phpns es multi-usuario, puede crear URLs amigables(SEO) y, opcionalmente, le ayuda a<br />
Crear / administrar plantillas.</p>
<p>La aplicación está construido con PHP, usa MySQL para almacenar los datos y viene con un<br />
instalador web.</p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=342&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_342" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Phpns%2C+Web+de+Noticias+con+CMS+http://b5iix.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Phpns%2C+Web+de+Noticias+con+CMS+http://b5iix.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2010/03/08/phpns-web-de-noticias-con-cms/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Captcha Basado en click &#8211; Un Captcha totalmente diferente</title>
		<link>http://www.scriptmatico.com/2009/10/03/captcha-basado-en-click-un-captcha-totalmente-diferente/</link>
		<comments>http://www.scriptmatico.com/2009/10/03/captcha-basado-en-click-un-captcha-totalmente-diferente/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 04:34:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[anti robot]]></category>
		<category><![CDATA[antirobot]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[validacion]]></category>

		<guid isPermaLink="false">http://www.scriptmatico.com/?p=295</guid>
		<description><![CDATA[En este tutorial, el objetivo es hacer un "click" en el captcha para validar que el formulario no haya sido rellenado por un robot.
Vamos a necesitar dos imágenes:
La Imagen de seguridad:

La imagen de la máscara de Captcha:

A continuación pondre el codigo explicado:
PLAIN TEXT
PHP:




&#60;?php


&#160;


&#160; // iniciamos la session


&#160; session_start&#40;&#41;;


&#160;


&#160; // declaramos nuestras variables


&#160; $width = 180;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>En este tutorial, el objetivo es hacer un "click" en el captcha para validar que el formulario no haya sido rellenado por un robot.</p>
<p>Vamos a necesitar dos imágenes:</p>
<p>La Imagen de seguridad:<br />
<a href="http://www.scriptmatico.com/wp-content/uploads/2009/10/captcha_image.jpg"><img src="http://www.scriptmatico.com/wp-content/uploads/2009/10/captcha_image.jpg" alt="" title="captcha_image" width="180" height="90" class="alignnone size-medium wp-image-292" /></a><br />
La imagen de la máscara de Captcha:<br />
<a href="http://www.scriptmatico.com/wp-content/uploads/2009/10/captcha_mask_image.jpg"><img src="http://www.scriptmatico.com/wp-content/uploads/2009/10/captcha_mask_image.jpg" alt="" title="captcha_mask_image" width="180" height="90" class="alignnone size-medium wp-image-293" /></a></p>
<p>A continuación pondre el codigo explicado:</p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<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:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">// iniciamos la session</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/session_start"><span style="color:#000066;">session_start</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-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;">&nbsp; <span style="color:#FF9933; font-style:italic;">// declaramos nuestras variables</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; <span style="color:#0000FF;">$width</span> = <span style="color:#CC66CC;color:#800000;">180</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$height</span> = <span style="color:#CC66CC;color:#800000;">90</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; <span style="color:#0000FF;">$blob_width</span> = <span style="color:#CC66CC;color:#800000;">40</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$blob_height</span> = <span style="color:#CC66CC;color:#800000;">40</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;">&nbsp; <span style="color:#FF9933; font-style:italic;">// creamos nuestra imagen</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; <span style="color:#0000FF;">$image</span> = imagecreatetruecolor<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$width</span>, <span style="color:#0000FF;">$height</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;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">//color background de la imagen</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$white</span> = imagecolorallocate<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</span>, <span style="color:#CC66CC;color:#800000;">230</span>, <span style="color:#CC66CC;color:#800000;">230</span>, <span style="color:#CC66CC;color:#800000;">230</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;">&nbsp; <span style="color:#0000FF;">$red</span>&nbsp; = imagecolorallocate<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</span>, <span style="color:#CC66CC;color:#800000;">255</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</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;">&nbsp; <span style="color:#0000FF;">$blue</span>&nbsp; = imagecolorallocate<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">230</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// llenamos el contenedor de la imagen</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; imagefilledrectangle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$width</span>, <span style="color:#0000FF;">$height</span> ,<span style="color:#0000FF;">$white</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;">&nbsp;</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;">&nbsp; <span style="color:#FF9933; font-style:italic;">// creamos el background de espirales para nuestra imagen</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;">&nbsp; <span style="color:#0000FF;">$theta</span>&nbsp; &nbsp; = <span style="color:#CC66CC;color:#800000;">1</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; <span style="color:#0000FF;">$thetac</span>&nbsp; &nbsp;= <span style="color:#CC66CC;color:#800000;">7</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$radius</span>&nbsp; &nbsp;= <span style="color:#CC66CC;color:#800000;">16</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; <span style="color:#0000FF;">$circles</span>&nbsp; = <span style="color:#CC66CC;color:#800000;">20</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$points</span>&nbsp; &nbsp;= <span style="color:#CC66CC;color:#800000;">32</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;">&nbsp; <span style="color:#616100;">for</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>; <span style="color:#0000FF;">$i</span> &lt;<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$circles</span> * <span style="color:#0000FF;">$points</span><span style="color:#006600; font-weight:bold;">&#41;</span> - <span style="color:#CC66CC;color:#800000;">1</span>; <span style="color:#0000FF;">$i</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;">&nbsp; <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$theta</span> = <span style="color:#0000FF;">$theta</span> + <span style="color:#0000FF;">$thetac</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; &nbsp; <span style="color:#0000FF;">$rad</span> = <span style="color:#0000FF;">$radius</span> * <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> / <span style="color:#0000FF;">$points</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$x</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rad</span> * <a href="http://www.php.net/cos"><span style="color:#000066;">cos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$theta</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#0000FF;">$x_axis</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; &nbsp; <span style="color:#0000FF;">$y</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rad</span> * <a href="http://www.php.net/sin"><span style="color:#000066;">sin</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$theta</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#0000FF;">$y_axis</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#0000FF;">$theta</span> = <span style="color:#0000FF;">$theta</span> + <span style="color:#0000FF;">$thetac</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; &nbsp; <span style="color:#0000FF;">$rad1</span> = <span style="color:#0000FF;">$radius</span> * <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$i</span> + <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span> / <span style="color:#0000FF;">$points</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$x1</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rad1</span> * <a href="http://www.php.net/cos"><span style="color:#000066;">cos</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$theta</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#0000FF;">$x_axis</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; &nbsp; <span style="color:#0000FF;">$y1</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$rad1</span> * <a href="http://www.php.net/sin"><span style="color:#000066;">sin</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$theta</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#0000FF;">$y_axis</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; imageline<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</span>, <span style="color:#0000FF;">$x</span>, <span style="color:#0000FF;">$y</span>, <span style="color:#0000FF;">$x1</span>, <span style="color:#0000FF;">$y1</span>, <span style="color:#0000FF;">$blue</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$theta</span> = <span style="color:#0000FF;">$theta</span> - <span style="color:#0000FF;">$thetac</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// obtenemos la posicion de nuestro circulo aleatoriamente</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; <span style="color:#0000FF;">$x_axis</span> = <a href="http://www.php.net/rand"><span style="color:#000066;">rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$blob_width</span>, <span style="color:#0000FF;">$width</span><span style="color:#006600; font-weight:bold;">&#41;</span> - <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$blob_width</span> / <span style="color:#CC66CC;color:#800000;">2</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;">&nbsp; <span style="color:#0000FF;">$y_axis</span> = <a href="http://www.php.net/rand"><span style="color:#000066;">rand</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$blob_height</span>, <span style="color:#0000FF;">$height</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; - <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$blob_height</span> / <span style="color:#CC66CC;color:#800000;">2</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// dibujamos el circulo </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; imagefilledellipse <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</span>, <span style="color:#0000FF;">$x_axis</span>, <span style="color:#0000FF;">$y_axis</span>, <span style="color:#0000FF;">$blob_width</span>, <span style="color:#0000FF;">$blob_height</span>, <span style="color:#0000FF;">$red</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;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">// creamos la imagen de mascara</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$mask_image</span> = imagecreatetruecolor<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$width</span>, <span style="color:#0000FF;">$height</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// escogemos el color de nuestro background y color de circulo para nuestra mascara</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; <span style="color:#0000FF;">$mask_white</span> = imagecolorallocate<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mask_image</span>, <span style="color:#CC66CC;color:#800000;">255</span>, <span style="color:#CC66CC;color:#800000;">255</span>, <span style="color:#CC66CC;color:#800000;">255</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;">&nbsp; <span style="color:#0000FF;">$mask_red</span>&nbsp; = imagecolorallocate<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mask_image</span>, <span style="color:#CC66CC;color:#800000;">255</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// llenamos la imagen mascara con nuestro background</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; imagefilledrectangle<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mask_image</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#CC66CC;color:#800000;">0</span>, <span style="color:#0000FF;">$width</span>, <span style="color:#0000FF;">$height</span> ,<span style="color:#0000FF;">$mask_white</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;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">// dibujamos el circulo en nuestra mascara</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; imagefilledellipse <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mask_image</span>, <span style="color:#0000FF;">$x_axis</span>, <span style="color:#0000FF;">$y_axis</span>, <span style="color:#0000FF;">$blob_width</span>, <span style="color:#0000FF;">$blob_height</span>, <span style="color:#0000FF;">$mask_red</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#FF9933; font-style:italic;">// escribimos la imagen en el buffer</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; <a href="http://www.php.net/ob_start"><span style="color:#000066;">ob_start</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;">&nbsp; imagepng<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mask_image</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;">&nbsp; <span style="color:#0000FF;">$mask_image_data</span> = <a href="http://www.php.net/ob_get_contents"><span style="color:#000066;">ob_get_contents</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#FF9933; font-style:italic;">// recibimos los datos y limpiamos el buffer</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/ob_end_clean"><span style="color:#000066;">ob_end_clean</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-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;">&nbsp; <span style="color:#FF9933; font-style:italic;">// convertimos la imagen a Base64</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; <span style="color:#0000FF;">$mask_image_data_b64</span> =&nbsp; <a href="http://www.php.net/base64_encode"><span style="color:#000066;">base64_encode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$mask_image_data</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;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">// guardamos los datos en nuestra variable del servidor</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'captcha_image_code'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$mask_image_data_b64</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;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">// Enviamos las cabeceras del contenido</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-type: image/jpeg'</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;">&nbsp; <a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Cache-control: no-cache'</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;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">// lanzamos la imagen al navegador</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; imagejpeg<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; imagedestroy<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$image</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora el formulario:</p>
<div class="igBar"><span id="lhtml-9"><a href="#" onclick="javascript:showPlainTxt('html-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-9">
<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/form.html"><span style="color: #000000; font-weight: bold;">&lt;form</span></a> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">"&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;</span>&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;p&gt;</span>Name<span style="color: #009900;">&lt;br/&gt;</span><span style="color: #009900;">&lt;input type="</span><span style="color: #000066;">text</span><span style="color: #ff0000;">" name="</span><span style="color: #000066;">name</span><span style="color: #ff0000;">" /&gt;</span><span style="color: #009900;">&lt;/p&gt;</span>&nbsp; </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; &nbsp; &nbsp; <span style="color: #009900;">&lt;p&gt;</span>Comment<span style="color: #009900;">&lt;br/&gt;</span><span style="color: #009900;">&lt;textarea name="</span>message<span style="color: #ff0000;">"&gt;</span><span style="color: #009900;">&lt;/textarea&gt;</span><span style="color: #009900;">&lt;/p&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;p&gt;</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; &nbsp; &nbsp; &nbsp; Click the Red Circle to continue:<span style="color: #009900;">&lt;br/&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;input type='image' name='submit' src='captcha.php' alt='Captcha Security'&nbsp; /&gt;</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; &nbsp; &nbsp; <span style="color: #009900;">&lt;/p&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900;">&lt;/form&gt;</span> </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Por ultimo la validacion:</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<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;"><a href="http://www.php.net/session_start"><span style="color:#000066;">session_start</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;">&nbsp;</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; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/isset"><span style="color:#000066;">isset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'submit_x'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; <a href="http://www.php.net/isset"><span style="color:#000066;">isset</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'submit_y'</span><span style="color:#006600; font-weight:bold;">&#93;</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>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span>!<a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'name'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; !<a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'message'</span><span style="color:#006600; font-weight:bold;">&#93;</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>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// retrive the image captcha data</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span> = <a href="http://www.php.net/base64_decode"><span style="color:#000066;">base64_decode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'captcha_image_code'</span><span style="color:#006600; font-weight:bold;">&#93;</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$captcha_image</span> = imagecreatefromstring<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$x</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'submit_x'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$y</span> = <span style="color:#0000FF;">$_POST</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'submit_y'</span><span style="color:#006600; font-weight:bold;">&#93;</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// get the pixel color of the clicked x and y coordinate</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; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$rgb</span> = imagecolorat<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$captcha_image</span>, <span style="color:#0000FF;">$x</span>, <span style="color:#0000FF;">$y</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;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$color_tran</span> = imagecolorsforindex<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$captcha_image</span>, <span style="color:#0000FF;">$rgb</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// check if the color is red and red only</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; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$captcha_ok</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'red'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">255</span> &amp;&amp; <span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'green'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">0</span> &amp;&amp; <span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'blue'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">0</span> &amp;&amp; <span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'alpha'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">0</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;">&nbsp;</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; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$captcha_ok</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$result</span> = <span style="color:#FF0000;">"Thank you for submitting your comment."</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$result</span> = <span style="color:#FF0000;">"Please make sure you click the red circle!"</span>;&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$result</span> = <span style="color:#FF0000;">"Please fill out the entire form."</span>;&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Un cambio adicional aquí es recuperar la imagen de la máscara de la sesión y volver a poner esa imagen de un objeto y luego obtener el color del píxel de X e Y.</p>
<p>Para ello, primero tenemos que recuperar la imagen de la máscara de la sesión y luego descifrar como se muestra a continuación:</p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<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:#FF9933; font-style:italic;">// retrive the image captcha data</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$data</span> = <a href="http://www.php.net/base64_decode"><span style="color:#000066;">base64_decode</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$_SESSION</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'captcha_image_code'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A continuación, convertirlo de nuevo en una imagen del objeto utilizando la funcion ImageCreateFromString().</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<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;">$captcha_image</span> = imagecreatefromstring<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Luego recuperar la coordenadas X e Y desde el primer clic que el usuario envía, junto con el color del píxel usando imagecolorsforindex (). Nos aseguramos de que sólo se obtiene un color rojo y nada más.</p>
<div class="igBar"><span id="lphp-13"><a href="#" onclick="javascript:showPlainTxt('php-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-13">
<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:#FF9933; font-style:italic;">// obtenemos el&nbsp; color del pixel que fue clickeado con las coordenas &quot;x&quot; y &quot;y&quot;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$rgb</span> = imagecolorat<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$captcha_image</span>, <span style="color:#0000FF;">$x</span>, <span style="color:#0000FF;">$y</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;">&nbsp; <span style="color:#0000FF;">$color_tran</span> = imagecolorsforindex<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$captcha_image</span>, <span style="color:#0000FF;">$rgb</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;">&nbsp;</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; <span style="color:#FF9933; font-style:italic;">// verificamos que el color sea solo rojo</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color:#0000FF;">$captcha_ok</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'red'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">255</span> &amp;&amp; <span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'green'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">0</span> &amp;&amp; <span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'blue'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">0</span> &amp;&amp; <span style="color:#0000FF;">$color_tran</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'alpha'</span><span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span> ; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Despues de todo esto el formulario nos quedaria asi:</p>
<div class="igBar"><span id="lhtml-14"><a href="#" onclick="javascript:showPlainTxt('html-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-14">
<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;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>?php&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">session_start<span style="color: #66cc66;">&#40;</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">if<span style="color: #66cc66;">&#40;</span>isset<span style="color: #66cc66;">&#40;</span>$_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'submit_x'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> &amp;&amp; isset<span style="color: #66cc66;">&#40;</span>$_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'submit_y'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&nbsp; </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;">&nbsp; &nbsp; if<span style="color: #66cc66;">&#40;</span>!empty<span style="color: #66cc66;">&#40;</span>$_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'name'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> &amp;&amp; !empty<span style="color: #66cc66;">&#40;</span>$_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'message'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&nbsp; </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;">&nbsp; &nbsp; &nbsp; // retrive the image captcha <span style="color: #000066;">data</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; &nbsp; &nbsp; $data = base64_decode<span style="color: #66cc66;">&#40;</span>$_SESSION<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'captcha_image_code'</span><span style="color: #66cc66;">&#93;</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;">&nbsp;</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; &nbsp; &nbsp; $captcha_image = imagecreatefromstring<span style="color: #66cc66;">&#40;</span>$data<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;">&nbsp; &nbsp; &nbsp; $x = $_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'submit_x'</span><span style="color: #66cc66;">&#93;</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; &nbsp; &nbsp; $y = $_POST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'submit_y'</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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; &nbsp; &nbsp; // get the pixel <span style="color: #000066;">color</span> of the clicked x and y coordinate</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; $rgb = imagecolorat<span style="color: #66cc66;">&#40;</span>$captcha_image, $x, $y<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;">&nbsp; &nbsp; &nbsp; $color_tran = imagecolorsforindex<span style="color: #66cc66;">&#40;</span>$captcha_image, $rgb<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;">&nbsp;</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; &nbsp; &nbsp; // check if the <span style="color: #000066;">color</span> is red and red only</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; $captcha_ok = <span style="color: #66cc66;">&#40;</span>$color_tran<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'red'</span><span style="color: #66cc66;">&#93;</span> == <span style="color: #cc66cc;color:#800000;">255</span> &amp;&amp; $color_tran<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'green'</span><span style="color: #66cc66;">&#93;</span> == <span style="color: #cc66cc;color:#800000;">0</span> &amp;&amp; $color_tran<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'blue'</span><span style="color: #66cc66;">&#93;</span> == <span style="color: #cc66cc;color:#800000;">0</span> &amp;&amp; $color_tran<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'alpha'</span><span style="color: #66cc66;">&#93;</span> == <span style="color: #cc66cc;color:#800000;">0</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; if<span style="color: #66cc66;">&#40;</span>$captcha_ok<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>&nbsp; </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;">&nbsp; &nbsp; &nbsp; &nbsp; $result = <span style="color: #ff0000;">"Thank you for submitting your comment."</span>;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </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;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span>&nbsp; </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;">&nbsp; &nbsp; &nbsp; &nbsp; $result = <span style="color: #ff0000;">"Please make sure you click the red circle!"</span>;&nbsp; </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;">&nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; </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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span> else <span style="color: #66cc66;">&#123;</span>&nbsp; </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;">&nbsp; &nbsp; &nbsp; &nbsp; $result = <span style="color: #ff0000;">"Please fill out the entire form."</span>;&nbsp; </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;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span>&nbsp; </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: #66cc66;">&#125;</span>&nbsp; </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: #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;">&nbsp;</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: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>&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;"><a href="http://december.com/html/4/element/html.html"><span style="color: #000000; font-weight: bold;">&lt;html</span></a> xmlns=<span style="color: #ff0000;">"http://www.w3.org/1999/xhtml"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span>&nbsp; </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/head.html"><span style="color: #000000; font-weight: bold;">&lt;head&gt;</span></a></span>&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;"><a href="http://december.com/html/4/element/meta.html"><span style="color: #000000; font-weight: bold;">&lt;meta</span></a> <span style="color: #000066;">http-equiv</span>=<span style="color: #ff0000;">"Content-Type"</span> <span style="color: #000066;">content</span>=<span style="color: #ff0000;">"text/html; charset=utf-8"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>&nbsp; </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/title.html"><span style="color: #000000; font-weight: bold;">&lt;title&gt;</span></a></span>Captcha Demo<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title&gt;</span></span>&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;"><span style="color: #000000; font-weight: bold;">&lt;/head&gt;</span></span>&nbsp; </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;"><a href="http://december.com/html/4/element/body.html"><span style="color: #000000; font-weight: bold;">&lt;body&gt;</span></a></span>&nbsp; </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;"><span style="color: #000000; font-weight: bold;">&lt;</span></a>?php if<span style="color: #66cc66;">&#40;</span>!empty<span style="color: #66cc66;">&#40;</span>$result<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">"&lt;div style='color:#990000; margin-bottom: 20px;'&gt;</span>&quot; . $result . &quot;<span style="color: #009900;">&lt;/div&gt;</span>&quot;; ?&gt;&nbsp; </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;">&lt;form action="</span><span style="color: #000000; font-weight: bold;">&lt;</span></a>?php echo $_SERVER<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'PHP_SELF'</span><span style="color: #66cc66;">&#93;</span>; ?<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;&nbsp; </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; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>Name<span style="color: #009900;"><a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">&lt;br</span></a>/<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text"</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"name"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span>Comment<span style="color: #009900;"><a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">&lt;br</span></a>/<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">&lt;textarea</span></a> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"message"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/textarea&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&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;">&nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></a></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; Click the Red Circle to continue:<span style="color: #009900;"><a href="http://december.com/html/4/element/br.html"><span style="color: #000000; font-weight: bold;">&lt;br</span></a>/<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;">&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'image'</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">'submit'</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">'captcha.php'</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">'Captcha Security'</span>&nbsp; /<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;">&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&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;/form&gt;</span></span>&nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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;/body&gt;</span></span>&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;"><span style="color: #000000; font-weight: bold;">&lt;/html&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Ahora puedes implementarlo en tu web, puedes cambiar los colores y jugar un poco con esta validacion, veras que no es muy dificil.</p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=295&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_295" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Captcha+Basado+en+click+%E2%80%93+Un+Captcha+totalmente+diferente+http://rnirz.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Captcha+Basado+en+click+%E2%80%93+Un+Captcha+totalmente+diferente+http://rnirz.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2009/10/03/captcha-basado-en-click-un-captcha-totalmente-diferente/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FancyUpload &#8211; Correcciones para Flash Player 10</title>
		<link>http://www.scriptmatico.com/2009/06/04/fancyupload-correcciones-para-flash-player-10/</link>
		<comments>http://www.scriptmatico.com/2009/06/04/fancyupload-correcciones-para-flash-player-10/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 22:22:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.scriptmatico.com/?p=257</guid>
		<description><![CDATA[Creo que la mayoria que usamos esta libreria hemos detectado que al actualizar Flash Player a la version 10,  la libreria deja de funcionar, y para esto es necesario hacerle ciertas notificaciones,  Gracias a alejandro tenemos este precioso Update de la Libreria, les dejo el link directo a la descarga, asi como el demo de [...]]]></description>
			<content:encoded><![CDATA[<p>Creo que la mayoria que usamos esta libreria hemos detectado que al actualizar Flash Player a la version 10,  la libreria deja de funcionar, y para esto es necesario hacerle ciertas notificaciones,  Gracias a <a href="http://www.alejandroarco.es">alejandro</a> tenemos este precioso Update de la Libreria, les dejo el link directo a la descarga, asi como el <a href="http://www.alejandroarco.es/wp-content/uploads/2009/04/example_fancyupload_flash_10/">demo</a> de alejandro y el link hacia su articulo.</p>
<p>Muchas gracias Alejando.</p>
<p><a href="http://www.alejandroarco.es/wp-content/uploads/2009/05/example_fancyupload_flash_10.zip">Descargar FancyUpload</a></p>
<p><a href="http://www.alejandroarco.es/desarrollo-de-aplicaciones/ajax/fancyupload-para-flash-player-10/">Articulo Original</a></p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=257&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_257" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=FancyUpload+%E2%80%93+Correcciones+para+Flash+Player+10+http://nigtn.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=FancyUpload+%E2%80%93+Correcciones+para+Flash+Player+10+http://nigtn.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2009/06/04/fancyupload-correcciones-para-flash-player-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FancyUpload : Upload de archivos Usando Mootools Y Ajax</title>
		<link>http://www.scriptmatico.com/2009/02/18/fancyupload-upload-de-archivos-usando-mootools-y-ajax/</link>
		<comments>http://www.scriptmatico.com/2009/02/18/fancyupload-upload-de-archivos-usando-mootools-y-ajax/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 19:57:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.scriptmatico.com/?p=204</guid>
		<description><![CDATA[
FancyUpload es un uploader de archivos que ofrece poder subir múltiples archivos en cola y el menú de selección de carga con una animada barra de progreso. Es fácil de instalar, completamente styleable a través de CSS y XHTML y MooTools utiliza para trabajar en todos los navegadores modernos.
Hasta ahora es uno de los mejores [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.scriptmatico.com/wp-content/uploads/2009/02/fancyupload2.jpg"><img class="alignnone size-medium wp-image-206" title="fancyupload2" src="http://www.scriptmatico.com/wp-content/uploads/2009/02/fancyupload2-300x139.jpg" alt="" width="300" height="139" /></a></p>
<p>FancyUpload es un uploader de archivos que ofrece poder subir múltiples archivos en cola y el menú de selección de carga con una animada barra de progreso. Es fácil de instalar, completamente styleable a través de CSS y XHTML y MooTools utiliza para trabajar en todos los navegadores modernos.</p>
<p>Hasta ahora es uno de los mejores Uploaders que he encontrado y es muy similar a los que usan Gmail y Hotmail <img src='http://www.scriptmatico.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> , Aunque Wordpress usa uno igual apartir de la version 3.6 pero no estoy seguro de que sea el mismo script.</p>
<p>Puedes probar el demo dando click <a href="prj/demofancyupload" target="_blank"> aqui</a><br />
Bajar el codigo Fuente de <a href="sources/uploader.zip" target="_blank">aqui.</a></p>
<p>O puedes visitar la pagina web del autor: http://digitarald.de/project/fancyupload/2-0/showcase/photoqueue/</p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=204&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_204" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=FancyUpload+%3A+Upload+de+archivos+Usando+Mootools+Y+Ajax+http://e9fai.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=FancyUpload+%3A+Upload+de+archivos+Usando+Mootools+Y+Ajax+http://e9fai.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2009/02/18/fancyupload-upload-de-archivos-usando-mootools-y-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MooColorFinder (herramienta para obtener los colores de un sitio web)</title>
		<link>http://www.scriptmatico.com/2008/11/14/moocolorfinder-herramienta-para-obtener-los-colores-de-un-sitio-web/</link>
		<comments>http://www.scriptmatico.com/2008/11/14/moocolorfinder-herramienta-para-obtener-los-colores-de-un-sitio-web/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 23:08:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.exodo999.phpnet.us/2008/11/14/moocolorfinder-herramienta-para-obtener-los-colores-de-un-sitio-web/</guid>
		<description><![CDATA[MooColorFinder Herramienta online que permite extraer los colores de los que está formado un sitio web. Basta con ingresar la URL de la web que quieres saber el color y mooColorFinder se encarga de mostralos. Ofrecen además un código para incluir en tu sitio web que genera una nube de colores.
PLAIN TEXT
PHP:




$content = file_get_contents&#40;"http://www.artviper.net/colorfinder/colorreader.php?domain=YOURDOMAIN&#38;amp;width=xxx"&#41;;


echo $content; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.artviper.net/colorfinder.php"><strong><span style="color: #ff0000">MooColorFinder</span></strong></a> Herramienta online que permite extraer los colores de los que está formado un sitio web. Basta con ingresar la URL de la web que quieres saber el color y mooColorFinder se encarga de mostralos. Ofrecen además un código para incluir en tu sitio web que genera una nube de colores.</p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<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;">$content</span> = <a href="http://www.php.net/file_get_contents"><span style="color:#000066;">file_get_contents</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"http://www.artviper.net/colorfinder/colorreader.php?domain=YOURDOMAIN&amp;amp;width=xxx"</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;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$content</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><a href="http://www.artviper.net/colorfinder.php"><span style="color: #009900">http://www.artviper.net/colorfinder.php</span></a></p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=141&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_141" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=MooColorFinder+%28herramienta+para+obtener+los+colores+de+un+sitio+web%29+http://kr67q.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=MooColorFinder+%28herramienta+para+obtener+los+colores+de+un+sitio+web%29+http://kr67q.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2008/11/14/moocolorfinder-herramienta-para-obtener-los-colores-de-un-sitio-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DevSnippets una Nueva web que ofrece codigo para desarrolladores</title>
		<link>http://www.scriptmatico.com/2008/08/18/devsnippets-una-nueva-web-que-ofrece-codigo-para-desarrolladores/</link>
		<comments>http://www.scriptmatico.com/2008/08/18/devsnippets-una-nueva-web-que-ofrece-codigo-para-desarrolladores/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 00:28:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.exodo999.phpnet.us/2008/08/18/devsnippets-una-nueva-web-que-ofrece-codigo-para-desarrolladores/</guid>
		<description><![CDATA[Pues paseandome de nuevo por la internet me he encontrado con esta web http://devsnippets.com/ la cual contiene excelentes fragmentos de codigo tambien llamados snippets.
Y lo mejor de esta web es que como incentivo a los colaboradores estan ofreciendo $4600 dolares en premios a los 10 que mas envien codigos. Interesante verdad!
Pues creo que dejare de [...]]]></description>
			<content:encoded><![CDATA[<p>Pues paseandome de nuevo por la internet me he encontrado con esta web <a href="http://devsnippets.com/" target="_blank">http://devsnippets.com/</a> la cual contiene excelentes fragmentos de codigo tambien llamados snippets.</p>
<p>Y lo mejor de esta web es que como incentivo a los colaboradores estan ofreciendo $4600 dolares en premios a los 10 que mas envien codigos. Interesante verdad!</p>
<p>Pues creo que dejare de escribir aqui y me voy a poner a enviar codigo jeje.</p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=116&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_116" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=DevSnippets+una+Nueva+web+que+ofrece+codigo+para+desarrolladores+http://z8zbd.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=DevSnippets+una+Nueva+web+que+ofrece+codigo+para+desarrolladores+http://z8zbd.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2008/08/18/devsnippets-una-nueva-web-que-ofrece-codigo-para-desarrolladores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obtener el número de suscriptores de FeedBurner</title>
		<link>http://www.scriptmatico.com/2008/05/12/obtener-el-numero-de-suscriptores-de-feedburner/</link>
		<comments>http://www.scriptmatico.com/2008/05/12/obtener-el-numero-de-suscriptores-de-feedburner/#comments</comments>
		<pubDate>Mon, 12 May 2008 15:58:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.exodo999.phpnet.us/2008/05/12/obtener-el-numero-de-suscriptores-de-feedburner/</guid>
		<description><![CDATA[Estava leyendo en el Blog de InfectedFx un Articulo que me intereso mucho. Bueno Para empezar yo no tengo cuenta en FeedBurner pero creo que tendre que crear una   .
En fin empezaremos con el pequeño tutorial que dio InfectedFx:
Lo primero que haremos será ingresar a nuestra cuenta de FeedBurner, una vez identificados damos [...]]]></description>
			<content:encoded><![CDATA[<p>Estava leyendo en el Blog de InfectedFx un Articulo que me intereso mucho. Bueno Para empezar yo no tengo cuenta en FeedBurner pero creo que tendre que crear una <img src='http://www.scriptmatico.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  .</p>
<p>En fin empezaremos con el pequeño tutorial que dio InfectedFx:</p>
<p>Lo primero que haremos será ingresar a nuestra cuenta de FeedBurner, una vez identificados damos clic sobre el sitio que deseamos sacar el número de lectores.</p>
<p>El siguiente paso será ir a la pestaña llamada Publicize donde encontraremos multitud de opciones para publicar nuestro feed, ahí mismo sacamos la imagen (feedcount) pero en este caso seleccionamos la opción llamada Awareness API y la activamos.</p>
<p>Una vez que hemos activado el acceso externo (Awareness API) copiamos y pegamos este código en cualquier parte de su sitio, digamos que lo mostrarán en wp y lo quieren mostrar en la sidebar abren el archivo sidebar.php y pegan lo siguiente:</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<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:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//configuracion</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;">$miFeed</span>=<span style="color:#FF0000;">"http://api.feedburner.com/awareness/1.0/GetFeedData?uri=EL-NOMBRE-DE-SU-FEED"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Termina configuracion</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; &nbsp; <span style="color:#0000FF;">$fx</span> = curl_init<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;">&nbsp; &nbsp; curl_setopt<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fx</span>, CURLOPT_RETURNTRANSFER, <span style="color:#CC66CC;color:#800000;">1</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;">&nbsp; &nbsp; curl_setopt<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fx</span>, CURLOPT_URL, <span style="color:#0000FF;">$myFeed</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$datos</span> = curl_exec<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fx</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;">&nbsp; &nbsp; curl_close<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fx</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$xml</span> = <span style="color:#000000; font-weight:bold;">new</span> SimpleXMLElement<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$datos</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;">&nbsp; &nbsp; <span style="color:#0000FF;">$fxcount</span> = <span style="color:#0000FF;">$xml</span>-&gt;<span style="color:#006600;">feed</span>-&gt;<span style="color:#006600;">entry</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'circulation'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Donde EL-NOMBRE-DE-SU-FEED deben de cambiarlo por el que corresponde<br />
Ejemplo: http://feeds.feedburner.com/infectedfx</p>
<p>Con esto ya tenemos el número de lectores en una variable llamada $fxcount ahora lo único que nos falta es imprimirla. así es que en donde deseen que aparezca ponen esto;</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<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:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$fxcount</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//Para WordPress con localización pueden poner esto:</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:#000000; font-weight:bold;">&lt;?php</span> <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$fxcount</span>; _e<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'infectados'</span>,<span style="color:#FF0000;">'infectedfx'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=98&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_98" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Obtener+el+n%C3%BAmero+de+suscriptores+de+FeedBurner+http://csc74.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Obtener+el+n%C3%BAmero+de+suscriptores+de+FeedBurner+http://csc74.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2008/05/12/obtener-el-numero-de-suscriptores-de-feedburner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forzar la descarga de un fichero (Archivo) con PHP otra forma</title>
		<link>http://www.scriptmatico.com/2008/04/22/forzar-la-descarga-de-un-fichero-archivo-con-php-otra-forma/</link>
		<comments>http://www.scriptmatico.com/2008/04/22/forzar-la-descarga-de-un-fichero-archivo-con-php-otra-forma/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 02:02:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.exodo999.phpnet.us/2008/04/22/forzar-la-descarga-de-un-fichero-archivo-con-php-otra-forma/</guid>
		<description><![CDATA[Hace unas semanas puse una forma de forzar la descarga de un archivo con PHP pero ahora les pongo otra forma:
PLAIN TEXT
PHP:




function descargaFichero &#40;$fichero&#41;


&#123;


$filename = basename&#40;$fichero&#41;;


$filesize = filesize&#40;$fichero&#41;;


&#160;


// 'application/octet-stream' es un tipo MIME registrado pero


// MSIE y Opera prefieren manejarlo asi 'application/octetstream'


$USR_BROWSER_AGENT="";


if &#40;preg_match&#40;'@Opera(/&#124; )([0-9].[0-9]{1,2})@', $_SERVER&#91;'HTTP_USER_AGENT'&#93;&#41;&#41; $USR_BROWSER_AGENT='OPERA';


if &#40;preg_match&#40;'@MSIE ([0-9].[0-9]{1,2})@', $_SERVER&#91;'HTTP_USER_AGENT'&#93;&#41;&#41; $USR_BROWSER_AGENT='IE';


$mime_type = &#40;$USR_BROWSER_AGENT == 'IE' &#124;&#124; [...]]]></description>
			<content:encoded><![CDATA[<p>Hace unas semanas puse una forma de forzar la descarga de un archivo con PHP pero ahora les pongo otra forma:</p>
<div class="igBar"><span id="lphp-23"><a href="#" onclick="javascript:showPlainTxt('php-23'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-23">
<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:#000000; font-weight:bold;">function</span> descargaFichero <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fichero</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:#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;">$filename</span> = <a href="http://www.php.net/basename"><span style="color:#000066;">basename</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fichero</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:#0000FF;">$filesize</span> = <a href="http://www.php.net/filesize"><span style="color:#000066;">filesize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fichero</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;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// 'application/octet-stream' es un tipo MIME registrado pero</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:#FF9933; font-style:italic;">// MSIE y Opera prefieren manejarlo asi 'application/octetstream'</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;">$USR_BROWSER_AGENT</span>=<span style="color:#FF0000;">""</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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/preg_match"><span style="color:#000066;">preg_match</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'@Opera(/| )([0-9].[0-9]{1,2})@'</span>, <span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'HTTP_USER_AGENT'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$USR_BROWSER_AGENT</span>=<span style="color:#FF0000;">'OPERA'</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;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><a href="http://www.php.net/preg_match"><span style="color:#000066;">preg_match</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'@MSIE ([0-9].[0-9]{1,2})@'</span>, <span style="color:#0000FF;">$_SERVER</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'HTTP_USER_AGENT'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#0000FF;">$USR_BROWSER_AGENT</span>=<span style="color:#FF0000;">'IE'</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;">$mime_type</span> = <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$USR_BROWSER_AGENT</span> == <span style="color:#FF0000;">'IE'</span> || <span style="color:#0000FF;">$USR_BROWSER_AGENT</span> == <span style="color:#FF0000;">'OPERA'</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:#FF0000;">'application/octetstream'</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:#FF0000;">'application/octet-stream'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</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:#FF9933; font-style:italic;">// Esta funcion esta operativa desde php 4.3.0 y puede ser una buena opcion para obtener el tipo MIME de un</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// fichero y su extension</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:#FF9933; font-style:italic;">//$mime_type=mime_content_type ($fichero);</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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-Type: '</span> . <span style="color:#0000FF;">$mime_type</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:#FF9933; font-style:italic;">// Se informa al navegador del tamaño del fichero y puede mostrar la barra de</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// progreso de descarga</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/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-Length: '</span> . <a href="http://www.php.net/filesize"><span style="color:#000066;">filesize</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fichero</span><span style="color:#006600; font-weight:bold;">&#41;</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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-Transfer-Encoding: binary'</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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Expires: '</span> . <a href="http://www.php.net/gmdate"><span style="color:#000066;">gmdate</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'D, d M Y H:i:s'</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">' GMT'</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:#FF9933; font-style:italic;">// IE necesita que le especifiquen las cabeceras</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:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$USR_BROWSER_AGENT</span> == <span style="color:#FF0000;">'IE'</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:#006600; font-weight:bold;">&#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:#FF9933; font-style:italic;">//header('Content-Disposition: inline; filename=&quot;' . $filename . '&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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-Disposition: attachment; filename=&quot;'</span> . <span style="color:#0000FF;">$filename</span> . <span style="color:#FF0000;">'&quot;'</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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Cache-Control: must-revalidate, post-check=0, pre-check=0'</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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Pragma: public'</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:#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;"><span style="color:#616100;">else</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;">&#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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Content-Disposition: attachment; filename=&quot;'</span> . <span style="color:#0000FF;">$filename</span> . <span style="color:#FF0000;">'&quot;'</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;"><a href="http://www.php.net/header"><span style="color:#000066;">header</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Pragma: no-cache'</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:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@<a href="http://www.php.net/readfile"><span style="color:#000066;">readfile</span></a> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fichero</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;"><a href="http://www.php.net/exit"><span style="color:#000066;">exit</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Para usar el script es solo mandar a llamar la funcion de esta forma:</p>
<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showPlainTxt('php-24'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<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;">descargaFichero <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"miarchivo.ppt"</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p class="akst_link"><a target="_blank" href="http://www.scriptmatico.com/?p=78&amp;akst_action=share-this"  title="Comparte esta publicaci&oacute;n en technorati, meneame, etc." id="akst_link_78" class="akst_share_link" rel="nofollow">Comp&aacute;rtelo!</a>
</p><p align="left"><a target="_blank" class="tt" href="http://twitter.com/home/?status=Forzar+la+descarga+de+un+fichero+%28Archivo%29+con+PHP+otra+forma+http://h3t9s.th8.us" title="Enviar a Twitter"><img class="nothumb" src="http://www.scriptmatico.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a target="_blank" class="tt" href="http://twitter.com/home/?status=Forzar+la+descarga+de+un+fichero+%28Archivo%29+con+PHP+otra+forma+http://h3t9s.th8.us" title="Enviar a Twitter">   </a></p>]]></content:encoded>
			<wfw:commentRss>http://www.scriptmatico.com/2008/04/22/forzar-la-descarga-de-un-fichero-archivo-con-php-otra-forma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
