<?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>Neleste 2.0 &#187; php</title>
	<atom:link href="http://www.neleste.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.neleste.com</link>
	<description>Información sobre Desarrollo Web</description>
	<lastBuildDate>Tue, 03 Aug 2010 13:07:33 +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>Optimizando nuestro código PHP</title>
		<link>http://www.neleste.com/optimizando-nuestro-codigo-php/</link>
		<comments>http://www.neleste.com/optimizando-nuestro-codigo-php/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 08:56:50 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Tutos]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.neleste.com/?p=178</guid>
		<description><![CDATA[1 – Inicializa las variables antes de utilizarlas. Estás, se inicializan solas, pero con un coste de tiempo.
2 – Debes estar en constante aprendizaje, cada vez el lenguage PHP se hace más fuerte, y salen nuevas características interesantes sobre este..
3 – Incrementar una variable en el método de una clase es lo mas rápido, que [...]]]></description>
			<content:encoded><![CDATA[<p>1 – Inicializa las variables antes de utilizarlas. Estás, se inicializan solas, pero con un coste de tiempo.</p>
<p>2 – Debes estar en constante aprendizaje, cada vez el lenguage PHP se hace más fuerte, y salen nuevas características interesantes sobre este..</p>
<p>3 – Incrementar una variable en el método de una clase es lo mas rápido, que incrementar una variable global.</p>
<p>4 – Incrementar una variable global a un fichero puede llegar a ser hasta dos veces más lento que en un entorno local.</p>
<p>5 – Incrementar una variable local en un método es lo más rápido. Casi lo mismo que llamar a una variable local en una función.</p>
<p>6 – Incrementar una variable indefinida puede ser hasta 9 ó 10 veces más lento que una ya declarada.</p>
<p>7 – Declarar una variable global, a pesar de que no la llegues a utilizar en ninguna función hace más lento tu script, PHP tiene que chequear si la variable existe.</p>
<p>8 – Llamar a una función a una función con un parametro puede tomar aproximadamente el mismo tiempo que de 7 a 8 operaciones con variables locales, y esa misma llamada a un método supondrían unas 15 operaciones. Aún así, es más rapido que usar variables globales.</p>
<p>9 – Si necesitas saber el timestamp (tiempo de ejecución) de acceso a un script, considera utilizar la variable $_SERVER['REQUEST_TIME'] en lugar de time(), es mucho más rapido.</p>
<p>10 – $row['id'] es hasta 7 veces más rápido que el mecanismo $row[id].</p>
<p>11 – $localvar++ es hasta 15 veces más rápido que function inc(){ $localvar++; }, debido a que debe acceder a la función.</p>
<p>12 – Los scripts PHP se compilan/interpretan cada vez que son ejecutados, a no ser se guarde el código objeto en un cache. Las herramientas de compilación de PHP pueden incrementan el rendimiento hasta un 100%.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/optimizando-nuestro-codigo-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Validar ccc con PHP</title>
		<link>http://www.neleste.com/validar-ccc-con-php/</link>
		<comments>http://www.neleste.com/validar-ccc-con-php/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 09:46:18 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Tutos]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ccc]]></category>

		<guid isPermaLink="false">http://www.neleste.com/?p=177</guid>
		<description><![CDATA[Identificación de una cuenta corriente o libreta de ahorros
En España las cuentas corrientes y las libretas de ahorros tienen una identidad única que se compone de 20 dígitos, el denominado Código Cuenta Cliente. Este código identifica a la entidad bancaria, sucursal y cuenta de forma única de tal modo que actúa como dirección de la [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Identificación de una cuenta corriente o libreta de ahorros</strong><br />
En España las cuentas corrientes y las libretas de ahorros tienen una identidad única que se compone de 20 dígitos, el denominado Código Cuenta Cliente. Este código identifica a la entidad bancaria, sucursal y cuenta de forma única de tal modo que actúa como dirección de la cuenta para la realización de cualquier operación financiera.</p>
<p><strong>Esquema del código de identificación de una cuenta bancaria</strong></p>
<p style="text-align: center;"><img class="aligncenter" style="text-align: center;" title="esquema ccc" src="http://www.neleste.com/wp-content/uploads/2010/01/esquema_codigo_cuenta_cliente.gif" alt="esquema ccc" /></p>
<p><strong>Proceso de cálculo de los dígitos de control</strong><br />
a) Dígito de control de la entidad y sucursal</p>
<table border="1">
<tbody>
<tr>
<td><strong>Posicion</strong></td>
<td><strong>Factor</strong></td>
<td><strong>Datos</strong></td>
<td><strong>Operación</strong></td>
<td><strong>Resultado</strong></td>
</tr>
<tr>
<td>Unidad:</td>
<td>6</td>
<td>8</td>
<td>6x8</td>
<td>48</td>
</tr>
<tr>
<td>Decena:</td>
<td>3</td>
<td>3</td>
<td>3x3</td>
<td>9</td>
</tr>
<tr>
<td>Centena:</td>
<td>7</td>
<td>3</td>
<td>7x3</td>
<td>21</td>
</tr>
<tr>
<td>Unidad de millar:</td>
<td>9</td>
<td>0</td>
<td>9x0</td>
<td>0</td>
</tr>
<tr>
<td>Decena de millar:</td>
<td>10</td>
<td>7</td>
<td>10x7</td>
<td>70</td>
</tr>
<tr>
<td>Centena de millar:</td>
<td>5</td>
<td>7</td>
<td>5x7</td>
<td>35</td>
</tr>
<tr>
<td>Unidad de millón:</td>
<td>8</td>
<td>0</td>
<td>8x0</td>
<td>0</td>
</tr>
<tr>
<td>Decena de millón:</td>
<td>4</td>
<td>2</td>
<td>4x2</td>
<td>8</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><strong>Suma</strong></td>
<td>191</td>
</tr>
</tbody>
</table>
<p>Cálculos:</p>
<p>191/11 = 17; Resto = 191-(17x11) = 4; Dígito = 11-4 = 7</p>
<p>- Si el resultado es 11, el dígito buscado es 0</p>
<p>- Si el resultado es 10, el dígito buscado es 1</p>
<p>b) Dígito de control de la cuenta</p>
<table border="1">
<tbody>
<tr>
<td><strong>Posicion</strong></td>
<td><strong>Factor</strong></td>
<td><strong>Datos</strong></td>
<td><strong>Operación</strong></td>
<td><strong>Resultado</strong></td>
</tr>
<tr>
<td>Unidad:</td>
<td>6</td>
<td>1</td>
<td>6x1</td>
<td>6</td>
</tr>
<tr>
<td>Decena:</td>
<td>3</td>
<td>2</td>
<td>3x2</td>
<td>6</td>
</tr>
<tr>
<td>Centena:</td>
<td>7</td>
<td>3</td>
<td>7x3</td>
<td>21</td>
</tr>
<tr>
<td>Unidad de millar:</td>
<td>9</td>
<td>4</td>
<td>9x4</td>
<td>36</td>
</tr>
<tr>
<td>Decena de millar:</td>
<td>10</td>
<td>5</td>
<td>10x5</td>
<td>50</td>
</tr>
<tr>
<td>Centena de millar:</td>
<td>5</td>
<td>2</td>
<td>5x2</td>
<td>10</td>
</tr>
<tr>
<td>Unidad de millón:</td>
<td>8</td>
<td>0</td>
<td>8x0</td>
<td>0</td>
</tr>
<tr>
<td>Decena de millón:</td>
<td>4</td>
<td>0</td>
<td>4x0</td>
<td>0</td>
</tr>
<tr>
<td>Centena de millón:</td>
<td>2</td>
<td>1</td>
<td>2x1</td>
<td>2</td>
</tr>
<tr>
<td>Unidad de millar de millón:</td>
<td>1</td>
<td>3</td>
<td>1x3</td>
<td>3</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><strong>Suma</strong></td>
<td>134</td>
</tr>
</tbody>
</table>
<p>Cálculos:</p>
<p>134/11 = 12; Resto = 191-(12x11) = 2; Dígito = 11-2 = 9</p>
<p>- Si el resultado es 11, el dígito buscado es 0</p>
<p>- Si el resultado es 10, el dígito buscado es 1<br />
<strong>A continuación, implementaremos el algoritmo en php</strong></p>
<div class="igBar"><span id="lphp-2"><a href="#" onclick="javascript:showPlainTxt('php-2'); return false;">C&oacute;digo</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-2">
<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> ccc_valido<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ccc</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;">&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;">//$ccc sería el 20770338793100254321</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;">$valido</span> = <span style="color:#000000; font-weight:bold;">true</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;">///////////////////////////////////////////////////</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;">//&nbsp; &nbsp; Dígito de control de la entidad y sucursal:</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 multiplica cada dígito por su factor de peso</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;">///////////////////////////////////////////////////</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;">$suma</span> = <span style="color:#CC66CC;color:#800000;">0</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">4</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">8</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">2</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">5</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">3</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">10</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">4</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">9</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">5</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <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;"><span style="color:#0000FF;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">6</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">3</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">7</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">6</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:#0000FF;">$division</span> = <a href="http://www.php.net/floor"><span style="color:#000066;">floor</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$suma</span>/<span style="color:#CC66CC;color:#800000;">11</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;">$resto</span>&nbsp; &nbsp; = <span style="color:#0000FF;">$suma</span> - <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$division</span>&nbsp; * <span style="color:#CC66CC;color:#800000;">11</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$primer_digito_control</span> = <span style="color:#CC66CC;color:#800000;">11</span> - <span style="color:#0000FF;">$resto</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><span style="color:#0000FF;">$primer_digito_control</span> == <span style="color:#CC66CC;color:#800000;">11</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$primer_digito_control</span> = <span style="color:#CC66CC;color:#800000;">0</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:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$primer_digito_control</span> == <span style="color:#CC66CC;color:#800000;">10</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;">$primer_digito_control</span> = <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;</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;">$primer_digito_control</span> != <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">8</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;"><span style="color:#0000FF;">$valido</span> = <span style="color:#000000; font-weight:bold;">false</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;">///////////////////////////////////////////////////</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;">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dígito de control de la cuenta:</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;">///////////////////////////////////////////////////</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;">$suma</span> = <span style="color:#CC66CC;color:#800000;">0</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">10</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">1</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">11</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">2</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">12</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">4</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">13</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">8</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">14</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">5</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">15</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">10</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">16</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">9</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">17</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">7</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">18</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">3</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;">$suma</span> += <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">19</span><span style="color:#006600; font-weight:bold;">&#93;</span> * <span style="color:#CC66CC;color:#800000;">6</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:#0000FF;">$division</span> = <a href="http://www.php.net/floor"><span style="color:#000066;">floor</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$suma</span>/<span style="color:#CC66CC;color:#800000;">11</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resto</span> = <span style="color:#0000FF;">$suma</span>-<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$division</span>&nbsp; * <span style="color:#CC66CC;color:#800000;">11</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;">$segundo_digito_control</span> = <span style="color:#CC66CC;color:#800000;">11</span>- <span style="color:#0000FF;">$resto</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;">$segundo_digito_control</span> == <span style="color:#CC66CC;color:#800000;">11</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$segundo_digito_control</span> = <span style="color:#CC66CC;color:#800000;">0</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><span style="color:#0000FF;">$segundo_digito_control</span> == <span style="color:#CC66CC;color:#800000;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$segundo_digito_control</span> = <span style="color:#CC66CC;color:#800000;">1</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:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$segundo_digito_control</span> != <span style="color:#0000FF;">$ccc</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#CC66CC;color:#800000;">9</span><span style="color:#006600; font-weight:bold;">&#93;</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;">$valido</span> = <span style="color:#000000; font-weight:bold;">false</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;">return</span> <span style="color:#0000FF;">$valido</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:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/validar-ccc-con-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter, Framework PHP</title>
		<link>http://www.neleste.com/codeigniter-framework-php/</link>
		<comments>http://www.neleste.com/codeigniter-framework-php/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 08:07:03 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[frameworks]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[framework]]></category>

		<guid isPermaLink="false">http://www.neleste.com/?p=146</guid>
		<description><![CDATA[
CodeIgniter es un gran framework para PHP creado para ofrecer un alto rendimiento, además este framework es bastante ligero y muy sencillo de configurar.
A la larga lista de frameworks para PHP, y que ha conseguido que php vuelva a ser el lenguage de programación web por excelencia (recordemos que lo utilizan todas las grandes compañías [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-147 alignleft" style="float: left;" title="codeigniter" src="http://www.neleste.com/wp-content/uploads/2008/07/codeigniter.jpg" alt="Framework php" width="125" height="137" /></p>
<p>CodeIgniter es un gran framework para PHP creado para ofrecer un alto rendimiento, además este framework es bastante ligero y muy sencillo de configurar.</p>
<p>A la larga lista de frameworks para PHP, y que ha conseguido que php vuelva a ser el lenguage de programación web por excelencia (recordemos que lo utilizan todas las grandes compañías online) dejando en la cuneta a otros grandes lenguages como ruby y su framework rails; este framework podría pasar por una alternativa mas, pero si la aplicación que desarrollamos requiere de una plataforma que no decante mucho nuestra estructura y que necesite un alto CodeIgniter debería ser tu elección.</p>
<p>Cumple perfectamente el fin de cualquier framework, una estructura bien definida que da soporte a nuestro proyecto web y que ayude a que este nuevo proyecto sea organizado y desarrollado.</p>
<p>La <a rel="nofollow" href="http://codeigniter.com/user_guide/">documentación</a> de CodeIgniter es muy buena y esto nos facilita en gran medida aprender a utilzarlo, sólo echando un simple vistazo a los <a rel="nofollow" href="http://codeigniter.com/tutorials/">videotutoriales</a> de su página sabremos como podemos empezar a utilizarlo.</p>
<p>Link | <a rel="nofollow" href="http://codeigniter.com/">Codelgniter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/codeigniter-framework-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ajax en php</title>
		<link>http://www.neleste.com/ajax-en-php/</link>
		<comments>http://www.neleste.com/ajax-en-php/#comments</comments>
		<pubDate>Thu, 29 May 2008 17:19:23 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Tutos]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.neleste.com/ajax-en-php/</guid>
		<description><![CDATA[Hoy en día resulta algo feo ver una página que no utiliza ajax, además que a los usuarios no nos gusta mucho ver como nuestras páginas vuelven a cargar a la hora de enviar un formulario, subir una imagen etc, etc.
La manera más sencilla de empezar a utilizar ajax, es con la clase xajax, que [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy en día resulta algo feo ver una página que no utiliza ajax, además que a los usuarios no nos gusta mucho ver como nuestras páginas vuelven a cargar a la hora de enviar un formulario, subir una imagen etc, etc.</p>
<p>La manera más sencilla de empezar a utilizar ajax, es con la clase xajax, que nos trae un cumulo de funciones que simplifican nuestra tarea. Está bastante bien implementada, y no le falta de nada. A continuación explicaré por qué resulta tan sencillo:<br />
<code>&lt;?php include './xajax/xajax_core/xajax.inc.php';$xajax = new xajax();$rqstAdd =&amp; $xajax-&gt;register(XAJAX_FUNCTION, 'doAdd');</code></p>
<p><code>$rqstReset =&amp; $xajax-&gt;register(XAJAX_FUNCTION, 'doReset');</code></p>
<p><code>// set the parameters$rqstAdd-&gt;setParameter(0, XAJAX_JS_VALUE, 39);</code></p>
<p><code>$rqstAdd-&gt;setParameter(1, XAJAX_JS_VALUE, 571);</code></p>
<p><code>$xajax-&gt;processRequest();</code></p>
<p><code>function doAdd($a, $b)</code><br />
<code>{</code></p>
<p><code>$response = new xajaxResponse();</code></p>
<p><code>$response-&gt;assign('answer', 'innerHTML', $a + $b);</code></p>
<p><code>$response-&gt;assign('reset', 'style.display', 'block');</code></p>
<p><code>return $response;</code></p>
<p><code>}</code></p>
<p><code>function doReset()</code></p>
<p><code>{</code></p>
<p><code>$response = new xajaxResponse();</code></p>
<p><code>$response-&gt;clear('answer', 'innerHTML');</code></p>
<p><code>$response-&gt;assign('reset', 'style.display', 'none');</code></p>
<p><code>return $response;</code></p>
<p><code>}</code></p>
<p><code>?&gt;</code><br />
Las funciones doreset y do add son las que proximamente podremos llamar desde cualquier parte de la pagina, sin necesidad de volver a cargarla!<br />
<code>&lt;form action="#" method="post"&gt;</code><br />
<code>&lt;input type="button" onclick="<strong>&lt;?php $rqstAdd-&gt;printScript(); ?&gt;</strong>" id="btnAdd" value="Click Me" /&gt;</code><br />
<code>&lt;input type="button" onclick="<strong>&lt;?php $rqstReset-&gt;printScript(); ?&gt;</strong>" id="btnReset" value="Reset" /&gt;</code><br />
<code>&lt;p id="answer"&gt;&lt;/p&gt;</code><br />
<code>&lt;/form&gt;</code></p>
<pre class="codeBlock" id="exampleSetup2"></pre>
<p>ahí esta el truco,  llamamos a las funciones en javascritp pero gracias a el objeto XmlHttpRequest, podemos interactuar con los ficheros php.</p>
<p>Link  | <a href="http://xajaxproject.org/" rel="nofollow">xajaxproject</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/ajax-en-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plugin ruby on rails</title>
		<link>http://www.neleste.com/plugin-ruby-on-rails/</link>
		<comments>http://www.neleste.com/plugin-ruby-on-rails/#comments</comments>
		<pubDate>Fri, 02 May 2008 09:35:08 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[hobo]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.neleste.com/plugin-ruby-on-rails/</guid>
		<description><![CDATA[
Los frameworks que han salido tanto para ruby como para php, permite simplificar mucho las funciones que antes se programaban a mano, haciéndose ahora de manera automática. Dentro de las comunidades tanto php como ruby on rails, hay multitud de extensiones y scripts que permiten hacernos la vida más sencilla.
Hobo es un plugin para Ruby [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://www.neleste.com/wp-content/uploads/2008/05/hobo.gif" alt="Hobo Imagen" /></p>
<p>Los frameworks que han salido tanto para <a href="http://www.neleste.com/ruby-on-rails-vs-php/" title="ruby vs php">ruby como para php</a>, permite simplificar mucho las funciones que antes se programaban a mano, haciéndose ahora de manera automática. Dentro de las comunidades tanto php como ruby on rails, hay multitud de extensiones y scripts que permiten hacernos la vida más sencilla.<br />
Hobo es un plugin para Ruby on Rails que añadirá velocidad turbo a el proceso de construcción de una aplicación web. Su características principales son:</p>
<ul>
<li>Plantillas que permiten definir tags personalizados.</li>
</ul>
<ul>
<li> Tags predefinidos y listos para usar AJAX.</li>
</ul>
<ul>
<li> Soporte de AJAX.</li>
</ul>
<ul>
<li> Soporte de temas.</li>
</ul>
<p>A todo el que quiera realizar aplicaciones web en ruby on rails le recomiendo echarle un ojo.</p>
<p>Link |  <a href="http://hobotek.net/blog/" title="hobo blog" rel="nofollow">HOBO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/plugin-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Login de usuarios en php</title>
		<link>http://www.neleste.com/login-de-usuarios-en-php/</link>
		<comments>http://www.neleste.com/login-de-usuarios-en-php/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 13:09:17 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutos]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[login]]></category>

		<guid isPermaLink="false">http://www.neleste.com/103/</guid>
		<description><![CDATA[Creamos la tabla usuarios

CREATE TABLE `usuarios` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(60) NOT NULL default '',
`password` varchar(60) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
//insertamos un valor como prueba
INSERT INTO `members` VALUES (1, 'juanra', '123456');
Ahora el fichero de checklogin 

&#60;?php
$host="localhost"; // El nombre del host, usualmente localhost
$username=""; // Nombre de usuario mysql
$password=""; // contraseña [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Creamos la tabla usuarios</strong><br />
<code><br />
CREATE TABLE `usuarios` (<br />
`id` int(4) NOT NULL auto_increment,<br />
`username` varchar(60) NOT NULL default '',<br />
`password` varchar(60) NOT NULL default '',<br />
PRIMARY KEY (`id`)<br />
) TYPE=MyISAM AUTO_INCREMENT=2 ;</code><br />
<code>//insertamos un valor como prueba<br />
INSERT INTO `members` VALUES (1, 'juanra', '123456');</code></p>
<p><strong>Ahora el fichero de checklogin </strong><br />
<code><br />
&lt;?php<br />
$host="localhost"; // El nombre del host, usualmente localhost<br />
$username=""; // Nombre de usuario mysql<br />
$password=""; // contraseña mysql<br />
$db_name="test"; // base de datos que usaremso<br />
$tbl_name="usuarios"; // nombre de la tabla</code><br />
<code><br />
//Conectamos con el servidor y seleccionamos la base de datos<br />
mysql_connect("$host", "$username", "$password")or die("cannot connect");<br />
mysql_select_db("$db_name")or die("cannot select DB");</code><br />
<code>//Cogemos los datos que nos llegan desde el formulario ( lo tendremos que crear)<br />
$minombre=$_POST['minombre'];<br />
$contraseña=$_POST['contraseña'];</code><br />
<code>// Unas pequeñas medidas de seguridad para proteger las bases de datos de posibles inyecciones<br />
$minombre = stripslashes($minombre);<br />
$contraseña = stripslashes($contraseña);<br />
$minombre = mysql_real_escape_string($minombre);<br />
$contraseña = mysql_real_escape_string($contraseña);</code><br />
<code><br />
$sql="SELECT * FROM $tbl_name WHERE username='$minombre' and password='$contraseña'";<br />
$result=mysql_query($sql);</code></p>
<p><code>// Contamos el numero de filas<br />
$count=mysql_num_rows($result);<br />
//Si el resultado marcado es $minombre y $contraseña,debería haber solo una fila<br />
if($count==1){</code></p>
<p><code>//Registramos usuario y redireccionamos a exito.php<br />
session_register("minombre");<br />
session_register("contraseña");<br />
header("location:exito.php");<br />
}<br />
else {<br />
echo "Nombre de usuario equivocado o contraseña";<br />
}<br />
?&gt;</code></p>
<p><strong>El exito.php... </strong></p>
<p><code>&lt;?//si llegamos aquí, todo fue bien<br />
session_start();<br />
if(!session_is_registered(myusername)){<br />
header("location:principal.php");<br />
}<br />
?&gt;</code></p>
<p><strong>Por último el formulario </strong></p>
<p>//a gusto del consumidor <img src='http://www.neleste.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/login-de-usuarios-en-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crear un captcha</title>
		<link>http://www.neleste.com/crear-un-captcha/</link>
		<comments>http://www.neleste.com/crear-un-captcha/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 20:26:54 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tutos]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[captcha]]></category>

		<guid isPermaLink="false">http://neleste.uni.cc/crear-un-captcha/</guid>
		<description><![CDATA[Es  habitual que se nos cuele mucho spam por formularios, y es que los spamers, suelen crear aplicaciones para enviar miles y miles de correos por formularios vulnerables, que envían copia del e-mail al autor, por ejemplo. Voy a iniciar un pequeño tutorial para crear un captcha, para "obligar a los usuarios a demostrar [...]]]></description>
			<content:encoded><![CDATA[<p>Es  habitual que se nos cuele mucho spam por formularios, y es que los spamers, suelen crear aplicaciones para enviar miles y miles de correos por formularios vulnerables, que envían copia del e-mail al autor, por ejemplo. Voy a iniciar un pequeño <a href="http://neleste.uni.cc/category/tutoriales/" title="tutoriales">tutorial</a> para crear un captcha, para "obligar a los usuarios a demostrar que son humanos".</p>
<p><strong>Primera Parte </strong><br />
<code>&lt;?php<br />
session_start();</code></p>
<p><code>//Creamos una cadena aleatoria de caracteres<br />
$md5 = md5(microtime() * mktime());</code></p>
<p><code>//Reducimos a 5 los caracteres<br />
$string = substr($md5,0,5);<br />
?&gt;</code></p>
<p><strong>Crear una imagen de fondo<br />
</strong></p>
<p><code>&lt;?php</code></p>
<p><code>//creamos un fondo de imagen y lo subimos, luego con la funcion imagecreatefrompng, la pasamos al captcha<br />
$captcha = imagecreatefrompng("./imagencaptcha.png");</code></p>
<p><code>//podemos configurar los colores para las lineas<br />
$black = imagecolorallocate($captcha, 0, 0, 0);<br />
$line = imagecolorallocate($captcha,233,239,239);</code><br />
<code><br />
//y para evitar las arañas le añadimos las lineas<br />
imageline($captcha,0,0,39,29,$line);<br />
imageline($captcha,40,0,64,29,$line);<br />
?&gt;</code></p>
<p><strong>Insertamos el texto en la imagen</strong></p>
<p><code>&lt;?php<br />
//insertamos la cadena creada aleatoriamente en la imagen<br />
imagestring($captcha, 5, 20, 10, $string, $black);<br />
</code><br />
<code>//como no, encriptamos y almacenamos el valor de la cadena en una variabe sesion<br />
$_SESSION['key'] = md5($string);</code><br />
<code><br />
//devolvemos la imagen para crearla<br />
header("Content-type: image/png");<br />
imagepng($captcha);<br />
?&gt;</code></p>
<p><strong>Comprobamos el valor que ingresa el usuario</strong></p>
<p><code>&lt;?php<br />
session_start();<br />
</code><br />
<code>if(md5($_POST['code']) != $_SESSION['key']){<br />
//lo enviamos a la página de error<br />
echo "header('Location: error.php');";<br />
}else{<br />
//lo enviamos a donde queríamos ha puesto bien el captcha<br />
echo "header('Location: buena.php');";<br />
}</code><br />
<code><br />
?&gt;</code></p>
<p>La parte de la creación del formulario en este caso, es la más básica.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/crear-un-captcha/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Chat en php</title>
		<link>http://www.neleste.com/chat-en-php/</link>
		<comments>http://www.neleste.com/chat-en-php/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 15:50:39 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[chat]]></category>

		<guid isPermaLink="false">http://neleste.uni.cc/chat-en-php/</guid>
		<description><![CDATA[
Con estos pequeños scripts en php, podrás montar un chat en tu web en poco tiempo. Solo tienes que insertarlo en tu web e ir indicando tu base de datos, dominio y contraseñas. Puedes borrar los enlaces, es completamente libre, pero siempre es de agradecer que no los eliminen y contribuyan a mejorar el pagerank [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center"><img src="http://www.neleste.com/wp-content/uploads/2008/02/chat.jpg" /></p>
<p>Con estos pequeños scripts en php, podrás montar un chat en tu web en poco tiempo. Solo tienes que insertarlo en tu web e ir indicando tu base de datos, dominio y contraseñas. Puedes borrar los enlaces, es completamente libre, pero siempre es de agradecer que no los eliminen y contribuyan a mejorar el pagerank de la web.</p>
<p>Descargar | <a href="http://www.neleste.com/files/chat.rar" title="Chat">chat </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/chat-en-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails Vs PHP</title>
		<link>http://www.neleste.com/ruby-on-rails-vs-php/</link>
		<comments>http://www.neleste.com/ruby-on-rails-vs-php/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 12:35:58 +0000</pubDate>
		<dc:creator>juanra</dc:creator>
				<category><![CDATA[Artículos]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://neleste.uni.cc/ruby-on-rails-vs-php/</guid>
		<description><![CDATA[Hoy en el trabajo me plantee un comparación Ruby on Rails Vs PHP. Buscando por internet, llegué a una conclusión, no podemos comparar un lenguaje de programación con un framework y un lenguaje de programación. La propia naturaleza de PHP como un lenguaje extremadamente liberal, no lo ata con ninguna tecnología extra. Sin embargo, la [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">Hoy en el trabajo me plantee un comparación Ruby on Rails Vs PHP. Buscando por internet, llegué a una conclusión,<span> </span>no podemos comparar un lenguaje de programación con un framework y un lenguaje de programación. La propia naturaleza de PHP como un lenguaje extremadamente liberal, no lo ata con ninguna tecnología extra. Sin embargo, la mejora del modelo de OOP en PHP5 trajo aparejado un número importante de Frameworks (Cake, PRADO, Symfony, etc.) que se van agregando al lote del Zend Framework.<span> </span>Por eso, las comparaciones serían <span> </span><span> </span>PHP On Zend Framework vs. Ruby On Rails o PHP on Cake vs. Ruby On Rails, por ejemplo.</p>
<p class="MsoNormal">Andi Gutmans, tampoco considera que se pueda hacer la comparación, pero dice algo interesante al respecto “Sentimos que PHP con Zend Framework es superior a RoR, y mientras otras personas lo vean de otra forma en cuanto a sus funcionalidades, definitivamente significa que Ruby estuvo siendo mejor publicitado. El diseño ingenioso del sitio de RoR y el marketing viral usado por 37signals le dio a RoR un mejor boca a boca que a PHP. Afortunadamente, esto ayuda a elevar la imagen de Zend y a incitar aun más el uso de su Framework.”</p>
<p class="MsoNormal">Fuente de apoyo |<a title="Maestros del Web" href="http://www.maestrosdelweb.com/editorial/rorphp/" target="_blank">Maestros del Web</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neleste.com/ruby-on-rails-vs-php/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
