<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-2626049794423758268</atom:id><lastBuildDate>Tue, 16 Jun 2026 11:08:36 +0000</lastBuildDate><category>PHP</category><category>Windows</category><category>xdebug</category><category>GNU/Linux</category><category>Sublime</category><category>html</category><category>jquery</category><category>CSS</category><category>Chakra</category><category>Como validar un formulario JQuery</category><category>Debian</category><category>JavaScript</category><category>Linux</category><category>Que hacer despues de instalar Chakra</category><category>Sistema Operativo</category><category>Tabla</category><category>Validar</category><category>ajax</category><category>daniel</category><category>dinamica</category><category>html php insertar tabla dinamica manualmente</category><category>lamp</category><category>netbeans</category><category>ubuntu</category><category>ui</category><title>Mi Pedacito De Internet</title><description>En este blog pretendo compartir todo lo que la vida me ha enseñado espero sea de su agrado :)</description><link>http://mipedacitodeinternet.blogspot.com/</link><managingEditor>noreply@blogger.com (Anonymous)</managingEditor><generator>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-8883371494581433451</guid><pubDate>Tue, 20 May 2014 03:09:00 +0000</pubDate><atom:updated>2014-05-19T20:09:46.797-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">GNU/Linux</category><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>¿Por qué usar Windows?</title><description>Cuando empecé redactar este artículo, la idea era enunciar en base a mi experiencia las razones por las que alguien debería animarse a probar GNU/Linux. Conforme fui madurando la idea me di cuenta que me siento tan a gusto usando GNU/Linux que decidí cambiar el sentido y cuestionarme por qué alguien debería usar Windows.&lt;br /&gt;
&lt;br /&gt;
En primer lugar hay que recordar que tanto una computadora como el sistema operativo que esta tiene, son solo herramientas y cada quien es libre de usar la herramienta con la que se sienta más cómodo. La comodidad de una u otra depende de las necesidades de cada quien.&lt;br /&gt;
&lt;br /&gt;
Mi uso de la computadora es en resumen: navegar por internet, programar en java o php, hacer documentos de texto o presentaciones con diapositivas, de vez en cuando editar alguna imagen, ver anime, escuchar música, ver &lt;strike&gt;porno&lt;/strike&gt;&amp;nbsp;imágenes en internet, redes sociales, videos, etc. Por lo que esas son mis necesidades, si puedo hacer todo eso cómodamente en mi GNU/Linux entonces ¿Por qué debería usar Windows?</description><link>http://mipedacitodeinternet.blogspot.com/2014/05/por-que-usar-windows.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-3656150353145524651</guid><pubDate>Wed, 02 Apr 2014 03:58:00 +0000</pubDate><atom:updated>2014-04-01T21:04:10.851-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sistema Operativo</category><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>Se acaba el soporte de Windows XP ¿Y a vos y a mi que nos importa?</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij60kF4BtfWp6CSnoexvl4ifnMl9Z-8de78JjUzFJ4G7d-P-N-AwP17mTdSCZa3BBwj7a7mgtSZnJFwoXdSLM6TDio8-0lz30jtcmSWFq_PacUQaUtZloydFFZmhl6LosMGQj3mXA4cCk/s1600/image.jpeg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij60kF4BtfWp6CSnoexvl4ifnMl9Z-8de78JjUzFJ4G7d-P-N-AwP17mTdSCZa3BBwj7a7mgtSZnJFwoXdSLM6TDio8-0lz30jtcmSWFq_PacUQaUtZloydFFZmhl6LosMGQj3mXA4cCk/s1600/image.jpeg&quot; height=&quot;103&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Seguramente te habrás enterado (o no) que este abril se termina el tiempo de soporte del mítico Windows XP. Bueno ¿Y eso que significa?&lt;br /&gt;
&lt;br /&gt;
En términos sencillos, significa que todo aquel que continúe usando este sistema operativo dejará de recibir actualizaciones del mismo; que las nuevas impresoras, tarjetas gráficas y otros dispositivos probablemente no funcionen porque los fabricantes no van a sacar drivers para XP y que muchos programas que usás como Office, Photoshop o Google Chrome no van a poderse instalar porque sencillamente quienes los desarrollan ya no van a dar soporte a este sistema.&lt;br /&gt;
&lt;br /&gt;
En otras palabras, Windos XP quedará &quot;abandonado&quot;.&lt;br /&gt;
&lt;br /&gt;
Ahora bien ¿Que podemos hacer? Tenemos las siguientes opciones:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Que se jodan, a seguir usando XP porque me funciona aunque eso signifique usar programas viejitos.&lt;/li&gt;
&lt;li&gt;Actualizar a versiones más recientes de Windows como Windows 7 o Windows 8 (¿alguien dijo Vista?) aunque la &quot;Lentium&quot; vaya a duras penas solo para cargar el menú inicio. &lt;/li&gt;
&lt;li&gt;Usar otros sistemas operativos como GNU/Linux de los que no tengo ni las más remota idea de como se usa.&lt;/li&gt;
&lt;li&gt;Quebrar el cochinito y comprar una Apple que va funcionar perfecto pero eso si, no voy a tener para comer todo el año&lt;/li&gt;
&lt;li&gt;Esperar las computadoras que va dar Cerén... Ok no XD&lt;/li&gt;
&lt;/ol&gt;
Bueno, quizás de los efectos más significativos es el hecho que muchos programas y dispositivos dejarían poco a poco de funcionar, puesto que lo de las actualizaciones, al menos yo en el tiempo que lo use NUNCA instalé una misera actualización y no tuve problemas por ello, sin embargo, no es algo que vaya a pasar de a noche a la mañana así que pienso podés seguir utilizando sin ningún problema Windows XP. Eso sí, ya es de ir pensando en cambiar de Sistema Operativo e ir analizando las diferentes alternativas que hay.&amp;nbsp; </description><link>http://mipedacitodeinternet.blogspot.com/2014/04/se-acaba-el-soporte-de-windows-xp-y-vos.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEij60kF4BtfWp6CSnoexvl4ifnMl9Z-8de78JjUzFJ4G7d-P-N-AwP17mTdSCZa3BBwj7a7mgtSZnJFwoXdSLM6TDio8-0lz30jtcmSWFq_PacUQaUtZloydFFZmhl6LosMGQj3mXA4cCk/s72-c/image.jpeg" height="72" width="72"/><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-6741630286614230440</guid><pubDate>Sun, 09 Mar 2014 04:01:00 +0000</pubDate><atom:updated>2014-06-05T13:25:11.576-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Chakra</category><category domain="http://www.blogger.com/atom/ns#">GNU/Linux</category><category domain="http://www.blogger.com/atom/ns#">Linux</category><category domain="http://www.blogger.com/atom/ns#">Que hacer despues de instalar Chakra</category><title>Que hacer después de instalar Chakra</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZAsq6BSa4TZJVR9KZNQtZ2TbkufyBYrFmzN3q002WU_PxRcjG_xin8244KgByiB2JgX2on8tnfdkQ_zvCALLPbixu6RW13zeHNLhjLlTkE-xS5Pi7sdtl8CTWKzcxEnbFbm2_den2DRk/s1600/08mar2014.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZAsq6BSa4TZJVR9KZNQtZ2TbkufyBYrFmzN3q002WU_PxRcjG_xin8244KgByiB2JgX2on8tnfdkQ_zvCALLPbixu6RW13zeHNLhjLlTkE-xS5Pi7sdtl8CTWKzcxEnbFbm2_den2DRk/s1600/08mar2014.png&quot; height=&quot;179&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Estas son las cosas que normalmente hago luego de instalar Chakra. Me funciona y he querido compartilo con ustedes, invitando a que si les interesa GNU/Linux no dejen de probar esta excelente distribución :D&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;H1 { margin-bottom: 0.21cm; }H1.western { font-family: &quot;Liberation Sans&quot;,sans-serif; font-size: 18pt; }H1.cjk { font-family: &quot;WenQuanYi Micro Hei&quot;; font-size: 18pt; }H1.ctl { font-family: &quot;Gargi-1.2b&quot;; font-size: 18pt; }P { margin-bottom: 0.25cm; line-height: 120%; }&lt;/style&gt;   &lt;br /&gt;
&lt;h1 class=&quot;western&quot;&gt;
Indicaciones&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Desinstalar Calligra y kde-wallpapers&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;sudo pacman -Rnsc calligra kde-wallpapers&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Actualizar el sistema&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;sudo pacman -Syu&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Habilitar el repositorio Extra&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Abrir preferencias del sistema.&lt;/li&gt;
&lt;li&gt;Clic en Chakra Repositories Editor.&lt;/li&gt;
&lt;li&gt;Activar la casilla de verificación de Extra.&lt;/li&gt;
&lt;li&gt;Clic en Aplicar.&lt;/li&gt;
&lt;li&gt;Escribir en consola: sudo pacman -Sy&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Instalar software necesario&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;sudo pacman -S libreoffice firefox firefox-i18n flashplugin   smplayer chromium kfilebox oxygen-gtk3 oxygen-gtk2&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
¿Esperabas algo más? Con lo anterior ya obtengo un sistema plenamente funcional en el que solo instalo cosas a medida las voy necesitando. El siguiente cuadro es un resumen de la gestión de paquetes:&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;P.sdfootnote { margin-left: 0.6cm; text-indent: -0.6cm; margin-bottom: 0cm; font-size: 10pt; line-height: 100%; }TH P { margin-bottom: 0cm; }TD P { margin-bottom: 0cm; }P { margin-bottom: 0.25cm; line-height: 120%; }A.sdfootnoteanc { font-size: 57%; }&lt;/style&gt;   &lt;br /&gt;
&lt;table cellpadding=&quot;4&quot; cellspacing=&quot;0&quot; style=&quot;width: 665px;&quot;&gt; &lt;colgroup&gt;&lt;col width=&quot;157&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;158&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;144&quot;&gt;&lt;/col&gt;  &lt;col width=&quot;172&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;thead&gt;
&lt;tr valign=&quot;TOP&quot;&gt;    &lt;th style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;&quot; width=&quot;157&quot;&gt;Acción/Fuente&lt;/th&gt;    &lt;th style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;&quot; width=&quot;158&quot;&gt;Repositorios&lt;a class=&quot;sdfootnoteanc&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=2626049794423758268#sdfootnote1sym&quot; name=&quot;sdfootnote1anc&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/th&gt;    &lt;th style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: 1px solid #000000; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0.1cm;&quot; width=&quot;144&quot;&gt;Comunitario&lt;a class=&quot;sdfootnoteanc&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=2626049794423758268#sdfootnote2sym&quot; name=&quot;sdfootnote2anc&quot;&gt;&lt;sup&gt;2&lt;/sup&gt;&lt;/a&gt;&lt;/th&gt;    &lt;th style=&quot;border: 1px solid #000000; padding: 0.1cm;&quot; width=&quot;172&quot;&gt;Locales&lt;/th&gt;   &lt;/tr&gt;
&lt;/thead&gt;  &lt;tbody&gt;
&lt;tr valign=&quot;TOP&quot;&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;157&quot;&gt;Instalar&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;158&quot;&gt;pacman -S nombre&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;144&quot;&gt;ccr -S nombre&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;172&quot;&gt;pacman -U nombre.tar.xz&lt;/td&gt;   &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;157&quot;&gt;Buscar&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;158&quot;&gt;pacman -Ss nombre&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;144&quot;&gt;ccr -Ss nombre&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;172&quot;&gt;N/A&lt;/td&gt;   &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;157&quot;&gt;Borrar&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;158&quot;&gt;pacman -Rns nombre&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;144&quot;&gt;N/A&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;172&quot;&gt;N/A&lt;/td&gt;   &lt;/tr&gt;
&lt;tr valign=&quot;TOP&quot;&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;157&quot;&gt;Actualizar Sistema&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;158&quot;&gt;pacman -Syu&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: none; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0cm; padding-top: 0cm;&quot; width=&quot;144&quot;&gt;ccr -Syu nombre&lt;/td&gt;    &lt;td style=&quot;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: none; padding-bottom: 0.1cm; padding-left: 0.1cm; padding-right: 0.1cm; padding-top: 0cm;&quot; width=&quot;172&quot;&gt;N/A&lt;/td&gt;   &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;
&lt;div id=&quot;sdfootnote1&quot;&gt;
&lt;div class=&quot;sdfootnote&quot;&gt;
&lt;a class=&quot;sdfootnotesym&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=2626049794423758268#sdfootnote1anc&quot; name=&quot;sdfootnote1sym&quot;&gt;1&lt;/a&gt;Se  puede hacer usando la interfaz gráfica.&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;sdfootnote2&quot;&gt;
&lt;div class=&quot;sdfootnote&quot;&gt;
&lt;a class=&quot;sdfootnotesym&quot; href=&quot;https://www.blogger.com/blogger.g?blogID=2626049794423758268#sdfootnote2anc&quot; name=&quot;sdfootnote2sym&quot;&gt;2&lt;/a&gt;Se  debe hacer como usuario normal, sin sudo.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Espero les sirva :D</description><link>http://mipedacitodeinternet.blogspot.com/2014/03/que-hacer-despues-de-instalar-chakra.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZAsq6BSa4TZJVR9KZNQtZ2TbkufyBYrFmzN3q002WU_PxRcjG_xin8244KgByiB2JgX2on8tnfdkQ_zvCALLPbixu6RW13zeHNLhjLlTkE-xS5Pi7sdtl8CTWKzcxEnbFbm2_den2DRk/s72-c/08mar2014.png" height="72" width="72"/><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-9158591271938207734</guid><pubDate>Wed, 23 Jan 2013 20:28:00 +0000</pubDate><atom:updated>2013-01-23T13:40:54.947-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Como validar un formulario JQuery</category><category domain="http://www.blogger.com/atom/ns#">CSS</category><category domain="http://www.blogger.com/atom/ns#">html</category><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><category domain="http://www.blogger.com/atom/ns#">jquery</category><category domain="http://www.blogger.com/atom/ns#">Validar</category><title>Validar un formulario con JQuery</title><description>Hoy aprenderemos como validar un formulario usando JQuery.&lt;br /&gt;
El formulario va estar conformado por 9 campos: nombre,&amp;nbsp;dirección&amp;nbsp; un numero mayor que 18, un numero mayor que el anterior, un numero de&amp;nbsp;teléfono, la hora,&amp;nbsp;un nombre de usuario, la contraseña y una&amp;nbsp;confirmación&amp;nbsp;de la contraseña. Todos los campos&amp;nbsp;serán&amp;nbsp;obligatorios.
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Nombre completo:&amp;nbsp;tendrá&amp;nbsp;como&amp;nbsp;único&amp;nbsp;requisito que tenga una longitud&amp;nbsp;mínima&amp;nbsp;de 10 caracteres&lt;/li&gt;
&lt;li&gt;Dirección&amp;nbsp;de correo:&amp;nbsp;tendrá&amp;nbsp;que cumplir con el formato correcto de direcciones de correo&amp;nbsp;electrónico&lt;/li&gt;
&lt;li&gt;El numero mayor que 18&amp;nbsp;deberá&amp;nbsp;ser obviamente mayor que 18&lt;/li&gt;
&lt;li&gt;El numero mayor que el anterior&amp;nbsp;deberá&amp;nbsp;ser mayor que el anterior&lt;/li&gt;
&lt;li&gt;El numero de&amp;nbsp;teléfono&amp;nbsp;tendrá&amp;nbsp;que cumplir con el formato&amp;nbsp;estándar&amp;nbsp;de (código&amp;nbsp;de&amp;nbsp;área&amp;nbsp;+numero de&amp;nbsp;teléfono&amp;nbsp; para ello si no se ingresa como es o si se copia y pega el numero debe darle la forma correcta,&amp;nbsp;así&amp;nbsp;como si se ingresan letras o caracteres basura&lt;/li&gt;
&lt;li&gt;La hora&amp;nbsp;tendrá&amp;nbsp;el formato de 24 horas pero no se&amp;nbsp;podrá&amp;nbsp;ingresar horas superiores a las 24 ni minutos superior a 60&lt;/li&gt;
&lt;li&gt;El nombre de usuario debe tener como&amp;nbsp;mínimo&amp;nbsp;5 caracteres y&amp;nbsp;deberá&amp;nbsp;comprobar que dicho nombre este disponible, es decir que no este almacenado en la base de datos&lt;/li&gt;
&lt;li&gt;La contraseña&amp;nbsp;deberá&amp;nbsp;tener como&amp;nbsp;mínimo&amp;nbsp;8 caracteres&lt;/li&gt;
&lt;li&gt;La&amp;nbsp;confirmación&amp;nbsp;de la contraseña debe ser igual a la contraseña ingresada&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Todos los datos deben estar correctos o de lo contrario el&amp;nbsp;botón&amp;nbsp;Enviar no debe funcionar.&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Primero descargamos los archivos. Para descargar JQuery en distribuciones GNU/Linux como Debian escribimos en terminal:&lt;br /&gt;
&lt;br /&gt;
sudo apt-get install libjs-jquery&lt;br /&gt;
&lt;br /&gt;
Encontraras los archivos en /usr/share/javascript/. Los menos afortunados lo pueden descargar de&amp;nbsp;acá:&amp;nbsp;&lt;a href=&quot;http://code.jquery.com/jquery-1.9.0.min.js&quot; target=&quot;_blank&quot;&gt;JQuery&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Para la&amp;nbsp;validación&amp;nbsp;utilizaremos el plugin&amp;nbsp;&lt;a href=&quot;http://docs.jquery.com/Plugins/Validation&quot; target=&quot;_blank&quot;&gt;JQuery Validation&lt;/a&gt;&amp;nbsp;que podemos descargar de&amp;nbsp;acá:&amp;nbsp;&lt;a href=&quot;http://jquery.bassistance.de/validate/jquery-validation-1.10.0.zip&quot; target=&quot;_blank&quot;&gt;JQuery Validate&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Tambien aplicaremos mascaras sobre los campos y para ello usaremos el plugin meioMask que podemos descargar&amp;nbsp;así:&lt;br /&gt;
&lt;br /&gt;
sudo apt-get install libjs-jquery-meiomask&lt;br /&gt;
&lt;br /&gt;
O lo pueden descargar desde esta pagina:&amp;nbsp;&lt;a href=&quot;https://raw.github.com/fabiomcosta/jquery-meiomask/master/jquery.meio.mask.js&quot; target=&quot;_blank&quot;&gt;JQuery Meio Mask&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Segundo, crearemos un formulario sencillo como el siguiente y lo guardamos en la ubicación que queramos. De preferencia crear una carpeta y tener todos los archivos que necesitamos:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;title&amp;gt;Ejemplo de Validation&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;form id=&quot;prueba&quot; name=&quot;prueba&quot;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;fieldset&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;lt;legend&amp;gt;Formulario de Prueba&amp;lt;/legend&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/fieldset&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Añadimos los archivos necesarios a nuestra pagina:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery.meiomask.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery.validate.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;messages_es.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;$(document).ready(function(){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp;$(&quot;#prueba&quot;).validate();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;jQuery(function($) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$(&#39;input[type=&quot;text&quot;]&#39;).setMask();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;});&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//Para añadir mi propia mascara&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;//$.mask.masks.nombre = {mask: &#39;9999-9999&#39;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora comenzaremos a añadir los campos.&amp;nbsp;Asegúrate&amp;nbsp;de añadir un &amp;lt;br&amp;gt;&amp;nbsp;después&amp;nbsp;de cada campo para que&amp;nbsp;estén&amp;nbsp;en lineas diferentes:&lt;br /&gt;
&lt;br /&gt;
El Nombre:&lt;br /&gt;
Validaremos que el nombre sea obligatorio y que tenga como&amp;nbsp;mínimo&amp;nbsp;10 caracteres, añadimos lo siguiente al formulario&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&amp;lt;label for=&quot;nombre&quot;&amp;gt;Nombre Completo:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;text&quot; name=&quot;nombre&quot; id=&quot;nombre&quot; placeholder=&quot;Escribe mas de 10 letras&quot; class=&quot;required&quot; minlength=&quot;10&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explicación: Añadimos class=&quot;required&quot; para indicar que el campo es obligatorio y mediante minlength=&quot;10&quot; indicamos que el campo debe tener al menos 10 caracteres&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
La&amp;nbsp;Dirección&amp;nbsp;de Correo:&lt;/div&gt;
&lt;div&gt;
El correo deber ser obligatorio y cumplir con el formato correcto. Para añadimos los siguiente&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&amp;lt;label for=&quot;email&quot;&amp;gt;Direccion de correo:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; placeholder=&quot;Ej: usuario@servidor.com&quot;&amp;nbsp;class=&quot;required email&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explicación: En este caso usamos class=&quot;required email&quot; para indicar que el campo es requerido y además debe tener el formato de dirección de correo electrónico.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El Numero Mayor o igual que 18:&lt;/div&gt;
&lt;div&gt;
Este numero debe ser mayor que 18 y el campo es obligatorio. Lo hacemos&amp;nbsp;así:&lt;/div&gt;
&lt;div&gt;
&amp;lt;input type=&quot;text&quot; name=&quot;num_min&quot; id=&quot;num_min&quot; placeholder=&quot;Escribe un numero mayor que 18&quot; class=&quot;required number&quot; min=&quot;18&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explicación: Primero indicamos mediante class=&quot;required number&quot; que el campo es obligatorio y que es un dato numérico. Luego indicamos que debe tener como valor mínimo 18&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El Numero Mayor o igual que el anterior:&lt;/div&gt;
&lt;div&gt;
Este numero debe ser mayor que el anterior y obligatorio. Lo hacemos&amp;nbsp;así:&lt;/div&gt;
&lt;div&gt;
&amp;lt;input type=&quot;text&quot; name=&quot;num_max&quot; id=&quot;num_max&quot; placeholder=&quot;Escribe un numero mayor que el anterior&quot; class=&quot;required number&quot; onfocus=&quot;document.prueba.num_max.min=document.prueba.num_min.value&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Explicación: para este campo indicamos su formato igual que el anterior y además añadimos un evento onfocus el cual asigno el valor&amp;nbsp;mínimo&amp;nbsp;del campo haciendo que el atributo min sea igual al valor del campo anterior&lt;br /&gt;
&lt;br /&gt;
Numero de&amp;nbsp;teléfono&amp;nbsp;más código de país:&lt;br /&gt;
La idea es que este campo solo tome valores&amp;nbsp;numéricos&amp;nbsp;y&amp;nbsp;automáticamente al formato de los números de teléfono.&amp;nbsp;&amp;nbsp;Lo insertamos de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;label for=&quot;tel&quot;&amp;gt;Ingresa tu numero de telefono mas el codigo de pais:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;text&quot; name=&quot;tel&quot; id=&quot;tel&quot; placeholder=&quot;Ej. (503) 2393-0000&quot; alt=&quot;phone-us&quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Explicación: En este campo utilizamos una mascara, la cual asignamos mediante el atributo alt=&quot;phone-us&quot; donde phone-us corresponde al nombre de la máscara utilizada. En este caso estamos usando una de las preestablecidas del plugin, pero podemos crear nuestras propias mascaras, como se indica en el código javascript que se indica más arriba en este mismo post.&lt;br /&gt;
&lt;br /&gt;
Hora:&lt;br /&gt;
La hora solamente debe aceptar valores numéricos y horas válidas. Lo insertamos&amp;nbsp;así:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;label for=&quot;time&quot;&amp;gt;Que hora es:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;text&quot; name=&quot;hora&quot; id=&quot;hora&quot; placeholder=&quot;Formato de 24 horas&quot; alt=&quot;time&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nombre de Usuario:&lt;br /&gt;
Para este campo primero crearemos una base de datos sencilla con la cual comprobar el nombre. Crea una base de datos llamada &quot;validacion&quot; (sin las comillas), y una tabla llamada &quot;usuario&quot;, con un campo llamado &quot;usuario&quot;, inserta los registros que quieras.&lt;br /&gt;
&lt;br /&gt;
Luego añade el campo de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;label for=&quot;user&quot;&amp;gt;Nombre de Usuario:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input for=&quot;text&quot; name=&quot;user&quot; id=&quot;user&quot; placeholder=&quot;Escribe tu nombre de Usuario&quot; remote=&quot;validar_usuario.php&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Donde la magia radica en el atributo remote, el cual hace referencia a un archivo &quot;validar_usuario.php&quot;, dentro de ese archivo se realiza la consulta y dependiendo del resultado se comprueba la disponibilidad del nombre. He&amp;nbsp;aquí&amp;nbsp;un ejemplo de lo que puede contener &quot;validar_usuario.php&quot; usando MySQL y PHP:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?&lt;br /&gt;
mysql_connect(&#39;localhost&#39;,&#39;root&#39;,&#39;root&#39;);&lt;br /&gt;
mysql_select_db(&#39;validacion&#39;);&lt;br /&gt;
$query=&quot;SELECT * FROM usuario WHERE usuario = &#39;&quot;.$_GET[&#39;user&#39;].&quot;&#39; &quot;;&lt;br /&gt;
$rs=mysql_query($query);&lt;br /&gt;
if(mysql_num_rows($rs)&amp;gt;0){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo &quot;false&quot;;&lt;br /&gt;
}&lt;br /&gt;
else{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo &quot;true&quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Se utiliza echo &quot;true&quot; para indicar que el nombre está disponible y echo &quot;false&quot; para indicar que el mismo ya está siendo utilizado&lt;br /&gt;
&lt;br /&gt;
Al probar este campo verás que el mensaje que se muestra no es el adecuado para el tipo de validación, pero puedes editar el archivo &quot;messages_es.js&quot; y editar el mensaje asignado a remote, para obtener uno con más significado.&lt;br /&gt;
&lt;br /&gt;
Password&lt;br /&gt;
El Password requiere de 8 caracteres como&amp;nbsp;mínimo&amp;nbsp;y es un campo obligatorio. Aplicamos la misma&amp;nbsp;validación&amp;nbsp;del nombre:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;label for=&quot;key&quot;&amp;gt;Password:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;password&quot; name=&quot;key&quot; id=&quot;key&quot; class=&quot;required&quot; minlength=&quot;8&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Donde usamos class=&quot;required&quot; para indicar que es obligatorio y minlength=&quot;8&quot; para indicar que debe tener al menos 8 caracteres.&lt;br /&gt;
&lt;br /&gt;
Confirmación del Password&lt;br /&gt;
La confirmación del password solamente requiere que sea obligatorio y que sea igual que el campo anterior.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;label for=&quot;key_equal&quot;&amp;gt;Repita su password:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;password&quot; name=&quot;key_equal&quot; id=&quot;key_equal&quot; class=&quot;required&quot; equalto=&quot;#key&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
En este último campo usamos el atributo equalto=&quot;#key&quot; para indicar con que valor debe ser comparado. #key corresponde al id del campo con el que se debe comparar.&lt;br /&gt;
&lt;br /&gt;
Por último añadimos un botón de tipo Submit&lt;br /&gt;
&amp;lt;input type=&quot;submit&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ahora solo resta probar la&amp;nbsp;validación&amp;nbsp;del formulario.&lt;br /&gt;
&lt;br /&gt;
EXTRA:&lt;br /&gt;
Por defecto el aspecto de la validación será un tanto fea. Eso lo podemos arreglar mediante css. He&amp;nbsp;aquí&amp;nbsp;un ejemplo, lo añadimos a nuestro formulario:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;style&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;label.error{color: red;float:right;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;input.error{border-color: red;}&lt;br /&gt;
&amp;lt;/style&amp;gt;&lt;br /&gt;
De esta manera jugando con la clase .error podemos personalizar la forma en que se presentan los errores.&lt;br /&gt;
&lt;br /&gt;
Otra cosa, es que debido a la&amp;nbsp;codificación&amp;nbsp;de caracteres cuando se trate de tildes y eñes&amp;nbsp;aparecerán&amp;nbsp;símbolos&amp;nbsp;raros en los mensajes. Esto es algo que no he podido resolver y en cuanto encuentre una solución la posteo.&lt;br /&gt;
&lt;br /&gt;
Les dejo también los enlaces a las páginas de referencia donde podrán encontrar la documentación completa y más tipo de validación de los plugins utilizados:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.meiocodigo.com/projects/meiomask/&quot; target=&quot;_blank&quot;&gt;Meio Mask&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://docs.jquery.com/Plugins/Validation&quot; target=&quot;_blank&quot;&gt;Validation&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Espero que esto sea de utilidad.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://mipedacitodeinternet.blogspot.com/2013/01/validar-un-formulario-con-jquery.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-8497716757976399092</guid><pubDate>Fri, 11 Jan 2013 22:29:00 +0000</pubDate><atom:updated>2013-01-11T14:29:53.209-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ajax</category><category domain="http://www.blogger.com/atom/ns#">dinamica</category><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">Tabla</category><title>Tabla Dinámica Manual con Ajax</title><description>En un post anterior vimos como &lt;a href=&quot;http://mipedacitodeinternet.blogspot.com/2011/11/ingresar-datos-en-una-tabla-dinamica-de.html&quot; target=&quot;_blank&quot;&gt;ingresar datos en una tabla dinámica&lt;/a&gt;, sin embargo este método provocaba un refresh en el navegador. Hoy veremos como hacer esto mismo evitando el efecto de refresh del navegador.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Primero descargamos los plugins necesarios para el trabajo:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://code.jquery.com/jquery-1.8.3.min.js&quot; target=&quot;_blank&quot;&gt;JQuery&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://malsup.github.com/jquery.form.js&quot; target=&quot;_blank&quot;&gt;JQuery Form&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora creamos el siguiente documento html:&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&lt;code&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
 &amp;lt;title&amp;gt;Tabla dinamica con Ajax&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
 &amp;lt;form name=&quot;form&quot; id=&quot;form&quot; method=&quot;post&quot; action=&quot;otroarchivo.php&quot;&amp;gt; &lt;br /&gt;
  &amp;lt;input type=&quot;hidden&quot; name=&quot;accion&quot;&amp;gt;&lt;br /&gt;
  &amp;lt;label&amp;gt;Nombres:&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;nombre&quot;&amp;gt;&lt;br /&gt;
  &amp;lt;label&amp;gt;Apellidos:&amp;lt;/label&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&quot;text&quot; name=&quot;apellidos&quot;&amp;gt;&lt;br /&gt;
  &amp;lt;input type=&quot;submit&quot; onclick=&quot;document.form.accion.value=&#39;anadir&#39;;&quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/form&amp;gt;&lt;br /&gt;
 &amp;lt;div id=&quot;salida&quot;&amp;gt;&lt;br /&gt;
  &amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Nombre&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Apellido&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;/table&amp;gt;&lt;br /&gt;
 &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;

&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
Lo guardamos con el nombre de &lt;i&gt;index.php &lt;/i&gt;dentro de una carpeta llamada tabladinamicaajax en nuestro servidor&lt;i&gt;. &lt;/i&gt;El archivo anterior consiste de un formulario con dos campos de texto, el cual tiene como destino o action otro archivo llamado &lt;i&gt;otroarchivo.php &lt;/i&gt;que crearemos posteriormente. El formulario tiene como id &lt;i&gt;form &lt;/i&gt;el cual utilizaremos después.&amp;nbsp;Luego tenemos un div con id &lt;i&gt;salida &lt;/i&gt;este nos&amp;nbsp;servirá&amp;nbsp;más adelante para contener a nuestra tabla dinámica.&amp;nbsp;También&amp;nbsp;dentro del formulario hay un botón de tipo submit con un evento onclick el cual sirve para asignarle un valor a un control tipo hidden que nos servirá como bandera para la inserción de registros a la tabla.&lt;br /&gt;
&lt;br /&gt;
Ahora añadiremos a nuestro archivo los enlaces a los plugins que acabamos de descargar. Para ello se deben guardar ambos archivos en la misma carpeta que el archivo anterior y luego añadimos dentro del head lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;jquery.form.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;
Hay que asegurarse que los nombre que están dentro del atributo src correspondan a los nombres de los archivos descargados.&lt;br /&gt;
&lt;br /&gt;
Lo siguiente es añadir el siguiente script justo debajo de los archivos:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;
  $(document).ready(function(){&lt;br /&gt;
  $(&#39;#form&#39;).submit(function(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).ajaxSubmit({&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; target: &#39;#salida&#39;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
 })&lt;br /&gt;
 &amp;lt;/script&amp;gt;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Donde #form corresponde al id del formulario que insertamos anteriormente y #salida corresponde al id del div que contiene la tabla.&lt;br /&gt;
&lt;br /&gt;
Con esto estamos evitando que se produzca el efecto de refresh en el formulario.&lt;br /&gt;
&lt;br /&gt;
Ahora vamos a añadir los registros a la tabla. Añadimos al principio del&amp;nbsp;código&amp;nbsp;lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;?&lt;br /&gt;
session_start();&lt;br /&gt;
if($_POST[&#39;accion&#39;]==&quot;&quot;){&lt;br /&gt;
 $_SESSION[&#39;contador&#39;]=0;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;
Este código sirve para inicializar un contador que se encargará de llevar el conteo de los registros ingresados en la tabla. Cuando $_POST[&#39;accion&#39;] vale es igual a vacio (la condición) se asume que es la primera vez que el formulario se carga o que se acaba de entrar a la página, este es precisamente el momento de inicializar el contador.&lt;br /&gt;
&lt;br /&gt;
Y con esto terminamos de editar el archivo del formulario. Ahora crearemos el archivo otroarchivo.php en la misma carpeta con el siguiente&amp;nbsp;código:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;?&lt;br /&gt;
session_start();&lt;br /&gt;
if($_POST[&#39;accion&#39;]==&quot;anadir&quot;){&lt;br /&gt;
 $_SESSION[&#39;datos&#39;][$_SESSION[&#39;contador&#39;]][&#39;nombre&#39;]=$_POST[&#39;nombre&#39;];&lt;br /&gt;
 $_SESSION[&#39;datos&#39;][$_SESSION[&#39;contador&#39;]][&#39;apellidos&#39;]=$_POST[&#39;apellidos&#39;];&lt;br /&gt;
 $_SESSION[&#39;contador&#39;]++;&lt;br /&gt;
 echo &quot;&amp;lt;table&amp;gt;&lt;br /&gt;
   &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Nombre&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Apellido&amp;lt;/th&amp;gt;&lt;br /&gt;
   &amp;lt;/tr&amp;gt;&quot;;&lt;br /&gt;
 for ($i=0; $i &amp;lt; $_SESSION[&#39;contador&#39;] ; $i++) { &lt;br /&gt;
  echo &quot;&amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&quot;.$_SESSION[&#39;datos&#39;][$i][&#39;nombre&#39;].&quot;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&quot;.$_SESSION[&#39;datos&#39;][$i][&#39;apellidos&#39;].&quot;&amp;lt;/td&amp;gt;&lt;br /&gt;
   &amp;nbsp;&amp;nbsp;&amp;lt;/tr&amp;gt;&quot;;&lt;br /&gt;
 }&lt;br /&gt;
 echo &quot;&amp;lt;/table&amp;gt;&quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;
&lt;/code&gt;

&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;&lt;/code&gt;Cada registro de la tabla es almacenado en una matriz de sesión por lo tanto este archivo comienza recuperando la sesión con &lt;i&gt;session_start()&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Después&amp;nbsp;de esto se comprueba el valor de &lt;i&gt;accion &lt;/i&gt;el cual de ser igual a anadir,&amp;nbsp;significaría&amp;nbsp;que se ha dado clic en el&amp;nbsp;botón&amp;nbsp;enviar, esto gracias al evento onclick colocado en el mismo. Luego se guardan los datos en la matriz y posteriormente se redibuja la tabla con los datos de la matriz&lt;br /&gt;
&lt;code&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/code&gt;Y ahora ejecutamos nuestro archivo index.php y vemos su funcionamiento. Algunos tips:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Para manipular los datos de la tabla se utilizará la matriz $_SESSION[&#39;datos&#39;] de esa manera podemos almacenar en la base de datos o lo que se requiera.&lt;/li&gt;
&lt;li&gt;Como la página no se refresca, los datos del formulario no se borran, esto fue completamente a&amp;nbsp;propósito&amp;nbsp;para que se observará el funcionamiento de ajax, pero cada uno deberá añadir al ejemplo el&amp;nbsp;código&amp;nbsp;para limpiar los campos que considere pertinentes&lt;/li&gt;
&lt;li&gt;Cualquier sugerencia o duda pueden comentar o añadirme al google+. Estoy para ayudar.&lt;/li&gt;
&lt;/ul&gt;
Espero que les haya sido de utilidad.</description><link>http://mipedacitodeinternet.blogspot.com/2013/01/tabla-dinamica-manual-con-ajax.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-4297649152942306454</guid><pubDate>Mon, 24 Dec 2012 22:17:00 +0000</pubDate><atom:updated>2013-01-12T13:14:22.986-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">Sublime</category><category domain="http://www.blogger.com/atom/ns#">Windows</category><category domain="http://www.blogger.com/atom/ns#">xdebug</category><title>[Windows] Sublime + PHP + XDebug en Windows</title><description>Anteriormente escribí como &lt;a href=&quot;http://mipedacitodeinternet.blogspot.com/2012/12/tutorial-php-debian-sublime-xdebug.html&quot; target=&quot;_blank&quot;&gt;configurar un entorno de desarrollo en php en linux&lt;/a&gt;&amp;nbsp;utilizando el editor Sublime, el servidor apache y el depurador XDebug. Ahora veremos como hacerlo pero en la plataforma de Windows.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;
Instalar Sublime&lt;/h2&gt;
&lt;div&gt;
Comenzamos instalando el editor de textos que podemos descargar de la siguiente dirección:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://www.sublimetext.com/2&quot; target=&quot;_blank&quot;&gt;http://www.sublimetext.com/2&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Una vez descargado procedemos a ejecutarlo para instalarlo.&lt;/div&gt;
&lt;h2&gt;
&lt;br /&gt;&lt;/h2&gt;
&lt;h2&gt;
Instalar Servidor Web&lt;/h2&gt;
&lt;div&gt;
Para los servicios web utilizaremos el potente servidor XAMPP que incluye Apache, MySQL, phpmyadmin, entre otros y podemos descarga desde esta dirección:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://www.apachefriends.org/en/xampp-windows.html&quot; target=&quot;_blank&quot;&gt;http://www.apachefriends.org/en/xampp-windows.html&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Cuando termine de descargar lo ejecutamos para instalarlo.&lt;/div&gt;
&lt;div&gt;
(Xampp requiera de ciertas librerias que de no estar instaladas abrirá el navegador para su respectiva descarga e instalación)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Cuando termine la instalación abrimos el panel de control de XAMPP y activamos los servicios Apache y MySQL. Podemos verificar que todo está correcto entrando en la dirección http://localhost&lt;/div&gt;
&lt;h2&gt;
&lt;br /&gt;&lt;/h2&gt;
&lt;h2&gt;
Habilitar XDebug&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; color: #29303b; line-height: 18px;&quot;&gt;Para habilitar la extensión xdebug, abrimos el archivo&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; color: #29303b; line-height: 18px;&quot;&gt;php.ini&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #29303b; line-height: 18px;&quot;&gt;&amp;nbsp;que se encuentra en el directorio donde se instaló Xampp, generalemente sera C:\xampp\php\php.ini&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white; color: #29303b; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; color: #29303b; line-height: 1.5em; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Buscamos la sección&amp;nbsp;&lt;span style=&quot;color: #669900;&quot;&gt;&lt;strong&gt;[XDebug]&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;y quitamos el comentario a las siguientes líneas:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #006699; line-height: 1.5em; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;zend_extension = “D:\xampp\php\ext\php_xdebug.dll”&lt;br /&gt;xdebug.remote_enable = 1&lt;br /&gt;xdebug.remote_handler = “dbgp”&lt;br /&gt;xdebug.remote_host = “localhost”&lt;br /&gt;xdebug.remote_port = 9000&lt;br /&gt;xdebug.profiler_enable = 1&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #29303b; line-height: 1.5em; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Por defecto las opciones xdebug.remote_enable y xdebug.profiler_enable vienen con el valor 0, así que simplemente las cambiamos a 1.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #29303b; line-height: 1.5em; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Re-iniciamos el servidor Apache, y comprobamos si la extensión xdebug ha sido cargada, observamos en la dirección:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #29303b; line-height: 1.5em; margin-bottom: 1em; padding: 0px; text-align: center;&quot;&gt;
&lt;span style=&quot;color: #ff9900;&quot;&gt;&lt;strong&gt;&lt;a href=&quot;http://localhost/xampp/phpinfo.php&quot; rel=&quot;nofollow&quot; style=&quot;color: #8a3207; text-decoration: initial;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;http://localhost/xampp/phpinfo.php&lt;/span&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #29303b; line-height: 1.5em; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;debe estar presente el siguiente mensaje:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #29303b; line-height: 1.5em; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;color: #003366;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This program makes use of the Zend Scripting Language Engine:&lt;br /&gt;Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;strong&gt;with Xdebug&lt;/strong&gt;&amp;nbsp;v2.1.1, Copyright (c) 2002-2011, by Derick Rethans&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; line-height: 1.5em; margin-bottom: 1em; padding: 0px;&quot;&gt;
Si todo ha ido bien ya debemos tener configurado XDebug en nuestro entorno de desarrollo, ahora vamos a configurar Sublime para que trabaje con el depurador:&lt;/div&gt;
&lt;h2&gt;
&lt;br /&gt;&lt;/h2&gt;
&lt;h2&gt;
Instalando Package Control&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
Añadiremos a nuestro editor un plugin que nos permite gestionar a los demás plugins, para ello abrimos sublime y luego en View &amp;gt; Show Console, pegamos en la consola lo siguiente:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #f3f3f3; color: #555555; font-family: Consolas, &#39;Droid Sans Mono&#39;, monospace; font-size: 14px; line-height: 25px; white-space: pre-wrap;&quot;&gt;import urllib2,os; pf=&#39;Package Control.sublime-package&#39;; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),&#39;wb&#39;).write(urllib2.urlopen(&#39;http://sublime.wbond.net/&#39;+pf.replace(&#39; &#39;,&#39;%20&#39;)).read()); print &#39;Please restart Sublime Text to finish installation&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #f3f3f3; color: #555555; font-family: Consolas, &#39;Droid Sans Mono&#39;, monospace; font-size: 14px; line-height: 25px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;line-height: 25px; white-space: pre-wrap;&quot;&gt;Luego reiniciamos sublime y ya tenemos Package control instalado&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;line-height: 25px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;
&lt;span style=&quot;line-height: 25px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;h2&gt;
&lt;span style=&quot;line-height: 25px; white-space: pre-wrap;&quot;&gt;Instalar SublimeXDdebug&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;span style=&quot;line-height: 25px; white-space: pre-wrap;&quot;&gt;Lo siguiente es instalar el plugin de xdebug, para ello presionamos CTRL+SHIFT+P, escribimos Install, escribimos xdebug y presionamos enter. Luego veremos el progreso de la instalación en la barra inferior del programa. Cuando haya terminado reiniciamos Sublime.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;line-height: 25px; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: medium;&quot;&gt;Instalar un ayudante de depurador&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Necesitaremos instalar un ayudante de depurador para que el navegador sepa que programa se encargará de la depuración (en este caso sublime). Yo uso el Google Chrome y&amp;nbsp;ahí&amp;nbsp;está el&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.google.com.sv/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;sqi=2&amp;amp;ved=0CDAQFjAA&amp;amp;url=https%3A%2F%2Fchrome.google.com%2Fwebstore%2Fdetail%2Fxdebug-helper%2Feadndfjplgieldjbigjakmdgkmoaaaoc&amp;amp;ei=foDKUPviNomy8AStuYDICg&amp;amp;usg=AFQjCNFpnyrnTLNcIvzJerb0BKGNmiWWsw&amp;amp;sig2=DwrFTteU6BizJ_NASkTHcA&amp;amp;bvm=bv.1355325884,d.eWU&quot; style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; text-decoration: initial;&quot; target=&quot;_blank&quot;&gt;XDebug Helper&lt;/a&gt;&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;, se instala y se configura de la siguiente manera en Herramientas &amp;gt; Extensiones. Debe quedar como en la imagen:&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;img alt=&quot;chrome-xdebug-settings&quot; src=&quot;http://www.digitaldisseny.com/images/noticias/2012/09/chrome-xdebug-settings.png&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; background-color: white; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid transparent; box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; padding: 8px;&quot; /&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Y ahora ya podemos comenzar a depurar :D&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: medium;&quot;&gt;Atajos de SublimeXDebug&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;ul style=&quot;background-color: white; border-width: 0px; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 22px; list-style-image: initial; list-style-position: initial; margin: 15px 0px; padding: 0px 0px 0px 30px;&quot;&gt;
&lt;li style=&quot;border: 0px none; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Shift+f8&lt;/code&gt;: Open XDebug quick panel&lt;/li&gt;
&lt;li style=&quot;border: 0px none; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;f8&lt;/code&gt;: Open XDebug control quick panel when debugger is connected&lt;/li&gt;
&lt;li style=&quot;border: 0px none; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+f8&lt;/code&gt;: Toggle breakpoint&lt;/li&gt;
&lt;li style=&quot;border: 0px none; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f5&lt;/code&gt;: Run to next breakpoint&lt;/li&gt;
&lt;li style=&quot;border: 0px none; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f6&lt;/code&gt;: Step over&lt;/li&gt;
&lt;li style=&quot;border: 0px none; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f7&lt;/code&gt;: Step into&lt;/li&gt;
&lt;li style=&quot;border: 0px none; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f8&lt;/code&gt;: Step out&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Ejemplo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;En sublime crea un archivo con el siguiente&amp;nbsp;código&amp;nbsp;y&amp;nbsp;guárdalo&amp;nbsp;en tu carpeta del servidor, que deberia ser C:\xampp\htdocs\ y se accede en http://localhost/ con el nombre de prueba.php&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;$i=2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;$j=2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;$k=2+2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;echo $k;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Añade un breakpoint en la linea 2 presionando CTRL+F8&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Presiona SHIFT + F8 y selecciona Start Debugging&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;En el navegador ingresa accede a tu archivo prueba.php, asegurate de que XDebug Helper esté activado (estará de color verde)&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Presiona F8 en sublime para ver las acciones disponibles o CTRL+SHIFT+f6, f7 u f8 para avanzar por las lineas de&amp;nbsp;código, o presiona F8 para obtener un&amp;nbsp;menú&amp;nbsp;con las opciones disponibles (para mas info. ver los atajos que&amp;nbsp;están&amp;nbsp;más arriba)&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Con esto podemos ir ejecutando nuestro&amp;nbsp;código&amp;nbsp;fuente li&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;nea por linea&lt;/span&gt;&lt;/div&gt;
</description><link>http://mipedacitodeinternet.blogspot.com/2012/12/windows-sublime-php-xdebug-en-windows.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>8</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-2350604046727181433</guid><pubDate>Fri, 14 Dec 2012 01:42:00 +0000</pubDate><atom:updated>2013-01-11T07:41:38.026-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Debian</category><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">Sublime</category><category domain="http://www.blogger.com/atom/ns#">xdebug</category><title>Tutorial PHP: Debian + Sublime + XDebug</title><description>Un editor que conocí hace poco y la verdad me ha encantado es Sublime, tanto que he decidido cambiarlo por Netbeans, posee autocompletado de texto, atajos útiles, una agradable interfaz y es posible añadirle funcionalidad por medio de plugins.&lt;br /&gt;
Hoy te voy a enseñar a configurar un entorno de desarrollo para php en linux, usando sublime como editor y xdebug como depurador.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Instalando Sublime&lt;/span&gt;&lt;br /&gt;
Lo primero seria pues instalar esta fabulosa aplicación, puedes descargarlo desde aqui:&lt;br /&gt;
&lt;a href=&quot;http://www.sublimetext.com/2&quot; target=&quot;_blank&quot;&gt;http://www.sublimetext.com/2&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Para instalarlo simplemente descomprime el archivo y copia la carpeta a cualquier ubicación por ejemplo la carpeta personal y ejecuta el archivo sublime_text que está dentro de la carpeta.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Instalar el servidor LAMP&lt;/span&gt;&lt;br /&gt;
Una vez está instalado nuestro editor, habría que instalar nuestro servidor, si es que no lo hemos hecho aún. En debian esto se logra&amp;nbsp;fácilmente&amp;nbsp;de la siguiente manera:&lt;br /&gt;
&lt;br /&gt;
Desde una terminal:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo apt-get install tasksel&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo tasksel install lamp-server&lt;/blockquote&gt;
(opcional) Podemos&amp;nbsp;también&amp;nbsp;crear una enlace para acceder a la carpeta del servidor asi&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
mkdir ~/htdocs&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo ln -s /home/$USER/htdocs/ /var/www/$USER&lt;/blockquote&gt;
En este último comando puedes dejarlo como está o poner tu nombre de usuario, ahora puedes guardar tus aplicaciones en la carpeta htdocs que acabas de crear y para acceder a ellos los haces asi:&lt;br /&gt;
http://localhost/tuusuario&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Instalar XDebug&lt;/span&gt;&lt;br /&gt;
Instalaremos XDebug de la siguiente forma&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo apt-get install php5-xdebug&lt;/blockquote&gt;
Luego editamos el siguiente archivo:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
gksu geany /etc/php5/conf.d/xdebug.ini&lt;/blockquote&gt;
y añadimos los siguiente:&lt;br /&gt;
&lt;pre class=&quot;bash&quot; style=&quot;background-color: white; color: #444444; font-size: 13px; line-height: 18px;&quot;&gt;&lt;/pre&gt;
&lt;pre class=&quot;bash&quot; style=&quot;background-color: white; color: #444444; font-size: 13px; line-height: 18px;&quot;&gt;xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;bash&quot; style=&quot;background-color: white; color: #444444; font-size: 13px; line-height: 18px;&quot;&gt;xdebug.remote_port=&lt;span style=&quot;background-color: transparent;&quot;&gt;9000&lt;/span&gt;&lt;span style=&quot;background-color: transparent;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
Ahora reiniciamos el servidor:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo service apache2 restart&lt;/blockquote&gt;
Para comprobar que todo está correcto, crea un archivo php en tu carpeta del servidor con el nombre que quieras y escribe el siguiente codigo&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;/code&gt;&amp;lt;? phpinfo(); ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Luego verifica el archivo desde el navegador y asegurate que ya aparezca la configuración de xdebug. Está casi al final.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Descargar y descomprimir Python2.6&lt;/span&gt;&lt;br /&gt;
El plugin que usaremos para añadir XDebug a Sublima utiliza las&amp;nbsp;librerías&amp;nbsp;de python2.6,&amp;nbsp;específicamente&amp;nbsp;la que se&amp;nbsp;incluía&amp;nbsp;en la versión 10.04 de ubuntu.&amp;nbsp;Así&amp;nbsp;que la descargaremos desde aquí:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://packages.ubuntu.com/lucid/python2.6&quot; target=&quot;_blank&quot;&gt;http://packages.ubuntu.com/lucid/python2.6&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Luego descomprimiremos el paquete descargado asi:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
dpkg-deb -x nombredelpaquete.deb python2.6&lt;/blockquote&gt;
Finalmente copiamos la carpeta /usr/lib/python2.6 de la carpeta que acabamos de descomprimir y lo pegamos en la carpeta lib de donde esta instalado sublime&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Instalar Package Control&lt;/span&gt;&lt;br /&gt;
Ahora instalaremos un plugin que servirá para poder añadir nuestro plugin de xdebug.&lt;br /&gt;
Desde sublime abrimos la consola en View &amp;gt; Show Console y pegamos los siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: whitesmoke; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.14902); color: #333333; font-family: Monaco, Menlo, Consolas, &#39;Courier New&#39;, monospace; font-size: 13px; line-height: 20px; margin-bottom: 10px; padding: 9.5px; white-space: pre-wrap; word-break: break-all; word-wrap: break-word;&quot;&gt;import urllib2,os; pf=&#39;Package Control.sublime-package&#39;; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),&#39;wb&#39;).write(urllib2.urlopen(&#39;http://sublime.wbond.net/&#39;+pf.replace(&#39; &#39;,&#39;%20&#39;)).read()); print &#39;Please restart Sublime Text to finish installation&#39;&lt;/pre&gt;
&lt;br /&gt;
Luego reiniciamos Sublime&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Instalar SublimeXDebug&lt;/span&gt;&lt;br /&gt;
Desde sublime presionamos CTRL + SHIFT + P, escribimos Install y seleccionamos Package Control: Install Package.&lt;br /&gt;
&lt;br /&gt;
Buscamos XDebug y los seleccionamos. Volvemos a reiniciar Sublime&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Instalar un ayudante de depurador&lt;/span&gt;&lt;br /&gt;
Necesitaremos instalar un ayudante de depurador para que el navegador sepa que programa se encargará de la depuración (en este caso sublime). Yo uso el Google Chrome y&amp;nbsp;ahí&amp;nbsp;está el&amp;nbsp;&lt;a href=&quot;https://www.google.com.sv/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;sqi=2&amp;amp;ved=0CDAQFjAA&amp;amp;url=https%3A%2F%2Fchrome.google.com%2Fwebstore%2Fdetail%2Fxdebug-helper%2Feadndfjplgieldjbigjakmdgkmoaaaoc&amp;amp;ei=foDKUPviNomy8AStuYDICg&amp;amp;usg=AFQjCNFpnyrnTLNcIvzJerb0BKGNmiWWsw&amp;amp;sig2=DwrFTteU6BizJ_NASkTHcA&amp;amp;bvm=bv.1355325884,d.eWU&quot; target=&quot;_blank&quot;&gt;XDebug Helper&lt;/a&gt;, se instala y se configura de la siguiente manera en Herramientas &amp;gt; Extensiones. Debe quedar como en la imagen:&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;chrome-xdebug-settings&quot; src=&quot;http://www.digitaldisseny.com/images/noticias/2012/09/chrome-xdebug-settings.png&quot; /&gt;&lt;br /&gt;
Y ahora ya podemos comenzar a depurar :D&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Atajos de SublimeXDebug&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;ul style=&quot;border-width: 0px; color: #333333; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 14px; line-height: 22px; margin: 15px 0px; padding: 0px 0px 0px 30px;&quot;&gt;
&lt;li style=&quot;border-width: 0px; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #dd1144; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Shift+f8&lt;/code&gt;: Open XDebug quick panel&lt;/li&gt;
&lt;li style=&quot;border-width: 0px; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #dd1144; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;f8&lt;/code&gt;: Open XDebug control quick panel when debugger is connected&lt;/li&gt;
&lt;li style=&quot;border-width: 0px; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #dd1144; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+f8&lt;/code&gt;: Toggle breakpoint&lt;/li&gt;
&lt;li style=&quot;border-width: 0px; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #dd1144; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f5&lt;/code&gt;: Run to next breakpoint&lt;/li&gt;
&lt;li style=&quot;border-width: 0px; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #dd1144; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f6&lt;/code&gt;: Step over&lt;/li&gt;
&lt;li style=&quot;border-width: 0px; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #dd1144; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f7&lt;/code&gt;: Step into&lt;/li&gt;
&lt;li style=&quot;border-width: 0px; line-height: 1.5; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(234, 234, 234); color: #dd1144; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 12px; margin: 0px 2px; padding: 0px 5px; white-space: nowrap;&quot;&gt;Ctrl+Shift+f8&lt;/code&gt;: Step out&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Ejemplo&lt;br /&gt;
En sublime crea un archivo con el siguiente&amp;nbsp;código&amp;nbsp;y&amp;nbsp;guárdalo&amp;nbsp;en tu carpeta del servidor con el nombre de prueba.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?&lt;br /&gt;
$i=2;&lt;br /&gt;
$j=2;&lt;br /&gt;
$k=2+2;&lt;br /&gt;
echo $k;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Añade un breakpoint en la linea 2 presionando CTRL+F8&lt;br /&gt;
&lt;br /&gt;
Presiona SHIFT + F8 y selecciona Start Debugging&lt;br /&gt;
&lt;br /&gt;
En el navegador ingresa accede a tu archivo prueba.php, asegurate de que XDebug Helper esté activado (estará de color verde)&lt;br /&gt;
&lt;br /&gt;
Presiona F8 en sublime para ver las acciones disponibles o CTRL+SHIFT+f6, f7 u f8 para avanzar por las lineas de&amp;nbsp;código, o presiona F8 para obtener un&amp;nbsp;menú&amp;nbsp;con las opciones disponibles (para mas info. ver los atajos que&amp;nbsp;están&amp;nbsp;más arriba)&lt;br /&gt;
&lt;br /&gt;
Con esto podemos ir ejecutando nuestro&amp;nbsp;código&amp;nbsp;fuente linea por linea&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
</description><link>http://mipedacitodeinternet.blogspot.com/2012/12/tutorial-php-debian-sublime-xdebug.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>5</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-7484968928996107096</guid><pubDate>Wed, 09 Nov 2011 05:21:00 +0000</pubDate><atom:updated>2013-01-11T07:43:55.286-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">daniel</category><category domain="http://www.blogger.com/atom/ns#">lamp</category><category domain="http://www.blogger.com/atom/ns#">netbeans</category><category domain="http://www.blogger.com/atom/ns#">ubuntu</category><category domain="http://www.blogger.com/atom/ns#">xdebug</category><title>Ubuntu: Servidor LAMP, Netbeans y XDebug</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
La fuente original de esta información es la siguiente:&lt;br /&gt;
&lt;a href=&quot;http://www.techytalk.info/ubuntu-netbeans-lamp-with-xdebug-nonroot/&quot;&gt;http://www.techytalk.info/ubuntu-netbeans-lamp-with-xdebug-nonroot/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Yo solo me encargué de traducirla. Bueno imaginemos esta situación: Estamos programando un proyecto en php, para ello escogemos Ubuntu (o cualquier otra distribución linux basada en Debian) y como IDE escogemos a Netbeans. Pues bueno la cuestión es que como principiantes en php muchas veces cometemos inocentes errores, y nos hacemos añicos buscándolos y buscándolos, (:O) a tal punto de querer destrozar nuestra pobre computadora. Y nos preguntamos, ¿Habrá alguna manera más fácil de corregir nuestro código? ¿Podemos ir ejecutando línea por línea, como lo hacíamos en Visual Studio? Pues la respuesta es XDebug, un depurador para php. En este Tutorial, vamos a aprender a configurar un ambiente de desarrollo en php, utilizando como Sistema Operativo a Ubuntu, un servidor LAMP (Linux Apache MySQL PHP), Netbeans y Xdebug para depurar nuestros códigos.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
La primer cosa que necesitamos hacer es instalar el servidor LAMP. En las distribuciones basadas en Debian esto se hace fácilmente, usando tasksel para seleccionar todos los paquetes necesarios para un servidor LAMP típico. Así lo primero que haremos será instalar tasksel. Digitamos en una terminal:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;apt-get&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;install&lt;/span&gt; tasksel&lt;/pre&gt;
&lt;br /&gt;
Lo siguiente es usar tasksel para instalar el LAMP server. Lo hacemos de esta manera:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #c20cb9; font-family: monospace; font-weight: bold;&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt; tasksel &lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-family: monospace; font-weight: bold;&quot;&gt;install&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt; lamp-server&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
En la mitad de la instalación, tasksel te va preguntar tu contraseña de root de MySQL. Es importante que anotes la contraseña que escribiste, porque esta contraseña va servir para accesar a la base de datos MySQL. Después que la instalación termine, vamos a instalar Xdebug y uno de los módulos de manipulación de imágenes PHP que todo desarrollador web va necesitar en su trabajo, llamado GD library. Este también es un buen momento para instalar Netbeans ya sea desde los repositorios de Ubuntu o descargar el ejecutable del sitio oficial. Para instalar Xdebug y el otro chunche, escribimos en una terminal lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;apt-get&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;install&lt;/span&gt; php5-xdebug php5-gd&lt;/pre&gt;
&lt;br /&gt;
Yo (el autor del Post original no yo XD) usualmente uso un directorio &quot;public_html&quot; dentro de mi carpeta personal, para almacenar todos los códigos de mis sitios web. Tu puedes usar cualquier directorio dentro de tu carpeta personal que quieras.&lt;br /&gt;
&lt;br /&gt;
Una cosa importante que hay que mencionar es que el servidor Web de Ubuntu lo inicia un usuario llamado &quot;www-data&quot; y el directorio donde vamos a guardar nuestras paginas web debe tener permisos de lectura y escritura para este usuario (no voy a entrar en detalles sobre este aspecto pero si te has sentido un tanto confundido por esto sería bueno que te leyeras algo sobre los procesos y usuarios en los sistemas linux). Entonces lo que vamos hacer es, poner como propietario de la carpeta &quot;public_html&quot; al usuario &quot;www-data&quot;. También nos interesa a nosotros como usuarios, tener los mismos permisos del dicho usuario sobre dicha carpeta. Esto se logra añadiendo nuestro usuario al grupo &quot;www-data&quot; (nuevamente te recomiendo leer sobre los usuarios y grupos en linux). Bueno todo este lío al final se hace con estas simples líneas de código:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mkdir&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;home&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$USER&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;public_html
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;chown&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-R&lt;/span&gt; www-data:www-data &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;home&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$USER&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;public_html
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;chmod&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-R&lt;/span&gt; &lt;span style=&quot;color: black;&quot;&gt;775&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;home&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #007800;&quot;&gt;$USER&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;public_html
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; adduser &lt;span style=&quot;color: #007800;&quot;&gt;$USER&lt;/span&gt; www-data&lt;/pre&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
Ahora que ya tenemos nuestra carpeta &quot;public_html&quot; en su lugar, debemos indicarle a Apache que use esa carpeta como documento raíz del servidor web (o sea que ahí se van a guardar las paginas web que hagamos). De manera que cuando vayamos a &quot;localhost&quot; o a &quot;127.0.0.1&quot; nos lleve a las paginas que están almacenados en nuestra carpeta &quot;public_html&quot;. Primeramente, hacemos una copia de la plantilla de sitio web por defecto y la modificamos:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;cp&lt;/span&gt; &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;etc&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;apache2&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;sites-available&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;default &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;etc&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;apache2&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;sites-available&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;/&lt;/span&gt;public_html&lt;/pre&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/pre&gt;
Ahora debemos editar nuestra plantilla para que apunte a la carpeta &quot;home/$USER/public_html&quot; en vez de la carpeta por defecto &quot;/var/www/&quot;. Lo que sigue es abrir nuestra nueva plantilla para editarla:&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;gksudo gedit &lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;etc&lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;apache2&lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;sites-available&lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;public_html&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Necesitamos modificar dos líneas: la primera es &quot;DocumentRoot&quot;, cambiamos &quot;/var/www&quot; por &quot;/home/tuusuario/public_html&quot;, luego la segunda sección &quot;Directory&quot;, cambiamos &quot;/var/www/&quot; por &quot;/home/tuusuario/public_html/&quot;. Hago especial énfasis que para el caso de la segunda línea que se modifica, hay que asegurarse de poner la &quot;/&quot; al final.&lt;br /&gt;
&lt;br /&gt;
Este es un ejemplo de mi propio archivo de configuración:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;apache&quot; style=&quot;font-family: monospace;&quot;&gt;&amp;lt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;VirtualHost&lt;/span&gt; *:&lt;span style=&quot;color: red;&quot;&gt;80&lt;/span&gt;&amp;gt;
 &lt;span style=&quot;color: #00007f;&quot;&gt;ServerAdmin&lt;/span&gt; webmaster@localhost
&amp;nbsp;
 &lt;span style=&quot;color: #00007f;&quot;&gt;DocumentRoot&lt;/span&gt; /home/danielito/public_html
 &amp;lt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt; /&amp;gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;Options&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FollowSymLinks&lt;/span&gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;AllowOverride&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;None&lt;/span&gt;
 &amp;lt;/&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt;&amp;gt;
 &amp;lt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt; /home/danielito/public_html/&amp;gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;Options&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Indexes&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FollowSymLinks&lt;/span&gt; MultiViews
  &lt;span style=&quot;color: #00007f;&quot;&gt;AllowOverride&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;None&lt;/span&gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;Order&lt;/span&gt; &lt;span style=&quot;color: #00007f;&quot;&gt;allow&lt;/span&gt;,&lt;span style=&quot;color: #00007f;&quot;&gt;deny&lt;/span&gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;allow&lt;/span&gt; from &lt;span style=&quot;color: blue;&quot;&gt;all&lt;/span&gt;
 &amp;lt;/&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt;&amp;gt;
&amp;nbsp;
 &lt;span style=&quot;color: #00007f;&quot;&gt;ScriptAlias&lt;/span&gt; /cgi-bin/ /usr/lib/cgi-bin/
 &amp;lt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;&quot;/usr/lib/cgi-bin&quot;&lt;/span&gt;&amp;gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;AllowOverride&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;None&lt;/span&gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;Options&lt;/span&gt; +ExecCGI -MultiViews +SymLinksIfOwnerMatch
  &lt;span style=&quot;color: #00007f;&quot;&gt;Order&lt;/span&gt; &lt;span style=&quot;color: #00007f;&quot;&gt;allow&lt;/span&gt;,&lt;span style=&quot;color: #00007f;&quot;&gt;deny&lt;/span&gt;
  &lt;span style=&quot;color: #00007f;&quot;&gt;Allow&lt;/span&gt; from &lt;span style=&quot;color: blue;&quot;&gt;all&lt;/span&gt;
 &amp;lt;/&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt;&amp;gt;
&amp;nbsp;
 &lt;span style=&quot;color: #00007f;&quot;&gt;ErrorLog&lt;/span&gt; ${APACHE_LOG_DIR}/error.log
&amp;nbsp;
 &lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# Possible values include: debug, info, notice, warn, error, crit,&lt;/span&gt;
 &lt;span style=&quot;color: #adadad; font-style: italic;&quot;&gt;# alert, emerg.&lt;/span&gt;
 &lt;span style=&quot;color: #00007f;&quot;&gt;LogLevel&lt;/span&gt; warn
&amp;nbsp;
 &lt;span style=&quot;color: #00007f;&quot;&gt;CustomLog&lt;/span&gt; ${APACHE_LOG_DIR}/access.log combined
&amp;nbsp;
    &lt;span style=&quot;color: #00007f;&quot;&gt;Alias&lt;/span&gt; /doc/ &lt;span style=&quot;color: #7f007f;&quot;&gt;&quot;/usr/share/doc/&quot;&lt;/span&gt;
    &amp;lt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;&quot;/usr/share/doc/&quot;&lt;/span&gt;&amp;gt;
        &lt;span style=&quot;color: #00007f;&quot;&gt;Options&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Indexes&lt;/span&gt; MultiViews &lt;span style=&quot;color: blue;&quot;&gt;FollowSymLinks&lt;/span&gt;
        &lt;span style=&quot;color: #00007f;&quot;&gt;AllowOverride&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;None&lt;/span&gt;
        &lt;span style=&quot;color: #00007f;&quot;&gt;Order&lt;/span&gt; &lt;span style=&quot;color: #00007f;&quot;&gt;deny&lt;/span&gt;,&lt;span style=&quot;color: #00007f;&quot;&gt;allow&lt;/span&gt;
        &lt;span style=&quot;color: #00007f;&quot;&gt;Deny&lt;/span&gt; from &lt;span style=&quot;color: blue;&quot;&gt;all&lt;/span&gt;
        &lt;span style=&quot;color: #00007f;&quot;&gt;Allow&lt;/span&gt; from 127.0.0.0/255.0.0.0 ::&lt;span style=&quot;color: red;&quot;&gt;1&lt;/span&gt;/&lt;span style=&quot;color: red;&quot;&gt;128&lt;/span&gt;
    &amp;lt;/&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;Directory&lt;/span&gt;&amp;gt;
&amp;nbsp;
&amp;lt;/&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;VirtualHost&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Ahora podemos deshabilitar el sitio por defecto de Ubuntu y habilitar nuestro sitio &quot;public_html&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; a2dissite default
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; a2ensite public_html&lt;/pre&gt;
&lt;br /&gt;
Lo que falta es configurar Xdebug para que permita depurar. Para ello editamos el archivo de configuración de Xdebug:&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;gksudo gedit &lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;etc&lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;php5&lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;conf.d&lt;/span&gt;&lt;span style=&quot;color: black; font-family: monospace; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;xdebug.ini&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Añadimos lo siguiente al final del archivo:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=&lt;span style=&quot;color: black;&quot;&gt;9000&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
Nada más resta reiniciar el servidor Apache:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;wp_syntax&quot;&gt;
&lt;div class=&quot;code&quot;&gt;
&lt;pre class=&quot;bash&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;sudo&lt;/span&gt; service apache2 restart&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
Y ¡FELICIDADES! ya tienes instalado un poderoso servidor LAMP con capacidad de depuración de php, para que ya no te matés buscando errores, que si que no te guarda, que no entra al if, que no se qué... jejeje. Para aprovechar esta característica te recomiendo usar un IDE como netbeans o eclipse (lo siento Dreamweaver ¬¬)</description><link>http://mipedacitodeinternet.blogspot.com/2011/11/ubuntu-servidor-lamp-netbeans-y-xdebug.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-1606536426144751763</guid><pubDate>Sun, 06 Nov 2011 16:02:00 +0000</pubDate><atom:updated>2013-01-11T07:45:24.243-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">html</category><category domain="http://www.blogger.com/atom/ns#">jquery</category><category domain="http://www.blogger.com/atom/ns#">ui</category><title>JQuery UI: JQuery para seres humanos XD</title><description>&lt;span id=&quot;goog_859261454&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://3.bp.blogspot.com/-qF1uOw3Lqt8/TgxqGVq6b2I/AAAAAAAAAN0/mp64NZLlC_Q/s1600/jqueryui.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;160&quot; src=&quot;http://3.bp.blogspot.com/-qF1uOw3Lqt8/TgxqGVq6b2I/AAAAAAAAAN0/mp64NZLlC_Q/s320/jqueryui.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Asi con esta mención de Ubuntu, quiero comentarles sobre esta herramienta muy importante: &lt;b&gt;JQuery UI. &lt;/b&gt;Considero yo que es una forma más sencilla de hacer uso de este potente framework.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Muchos ya sabemos lo que es JQuery, y para quienes no, un poco de wikipedia para estar en sintonía:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://es.wikipedia.org/wiki/JQuery&quot;&gt;JQuery&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora bien, JQuery UI (JQuery User Interface) viene siendo como una compilación de widgets, efectos, etc. que son parte de JQuery y que nos permite hacer uso de ellos de una manera más sencilla que con el propio JQuery (o al menos así lo concibo yo).&lt;br /&gt;
&lt;br /&gt;
JQuery UI se divide en 4 partes:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Interactions (interacciones):&lt;/b&gt; proporciona ciertas propiedades a los elementos, por ejemplo: que se puedan arrastrar, redimensionar, etc.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Widgets (se traduce igual XD):&lt;/b&gt; proporciona elementos que podemos utilizar en nuestra aplicación web, por ejemplo: selectores de fecha, menús tipo acordión, barras de progreso, etc.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Utilities (utilidades): &lt;/b&gt;Proporciona interacciones con los elementos.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;E&lt;/b&gt;&lt;b&gt;ffects (Efectos)&lt;/b&gt;: Proporciona efectos de transición para las interacciones.&lt;/li&gt;
&lt;/ul&gt;
La utilización es bastante sencilla, sería más o menos así:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ver para Creer&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Bueno, primeramente podemos ver su funcionamiento desde su página de demostración &lt;a href=&quot;http://jqueryui.com/demos/&quot;&gt;Demos de JQuery UI&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
En la página de Demos solo se selecciona el elemento que se desea ver, cada página de demostración esta bien documentada, ofreciendo distintos tipo de configuración para cada elemento y su respectivo código fuente para su utilización. Lamentablemente hay que dominar el inglés (aunque con super Google Traductor todo es posible).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Descargar&amp;nbsp;&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
Lo siguiente, luego de ver y decidir que se quiere ocupar, el tema preferido (si, se le pueden aplicar temas o skins muy bonitos) procedemos a descargar los archivos necesarios para implementarlo en nuestra aplicación. Para ello nos dirigimos a la página de descargas &lt;a href=&quot;http://jqueryui.com/download&quot;&gt;descargas de JQuery UI&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
En el sitio de descargas, seleccionamos los componentes que deseamos tener, el tema y la versión de JQuery UI. Al seleccionar todos los componentes, la descarga va ser de aprox: 1 MB (:O). No es tan pesado.&lt;br /&gt;
&lt;br /&gt;
La descarga es un archivo zip, que tenemos que descomprimir en un sitio conveniente. Dentro tenemos 3 carpetas y un archivo index.html. Lo que nos interesa son las carpetas css y js donde se encuentran el estilo css (tema o skin), y los archivos javascript que hacen que la magia funcione. Pues bien, solo bastaría con copiar estos archivos a nuestra carpeta web para empezar a usar esta maravillosa herramienta de los dioses :D&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Usar&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Ya con los archivos copiados en nuestra carpeta web, su utilización es sencilla, basta con referenciar los archivos necesarios (css y js) al código fuente:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;../js/jquery-1.6.2.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;../js/jquery-ui-1.8.16.custom.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../estilos/blitzer/jquery-ui-1.8.16.custom.css&quot;&amp;gt;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Importante mencionar que hay que tener cuidado de dejar el archivo JQuery antes del de JQuery UI ya que de lo contrario no funciona (¬¬ me ha pasado).&lt;br /&gt;
&lt;br /&gt;
Con esto ya estamos listos para usar cualquiera de los elementos que se incluyen en nuestro jquery ui. Para ello solo insertamos el codigo del elemento deseado. Este codigo podemos tomarlo de la pagina de demostracion de JQuery UI y combinar las configuraciones deseadas. Como ejemplo aquí un selector de fechas:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
$(function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;$(&quot;.date-pick&quot;).datepicker({ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;minDate: &quot;-100Y&quot;, &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;maxDate: &quot;+1M +10D&quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;changeMonth: true,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;changeYear: true&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/script&amp;gt;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
En esta código, seria prudente modificar unas cuantas cosas. Por ejemplo $(&quot;.date-pick&quot;), esto nos indica que para convertir un elemento a selector de fecha, se le debe pasar al atributo class ( es class debido al &quot;.&quot;, si fuera &quot;#&quot; entonces sería por medio del atributo id) el valor &quot;date-pick&quot;, esto se puede modificar a conveniencia. &lt;br /&gt;
&lt;br /&gt;
Espero que este post sea de utilidad y les hay gustado. No soy la gran eminencia programando, pero me gusta compartir lo poco que sé :) si les ha gustado comenten.</description><link>http://mipedacitodeinternet.blogspot.com/2011/11/jquery-ui-jquery-para-seres-humanos-xd.html</link><author>noreply@blogger.com (Anonymous)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-qF1uOw3Lqt8/TgxqGVq6b2I/AAAAAAAAAN0/mp64NZLlC_Q/s72-c/jqueryui.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2626049794423758268.post-8618623055927686681</guid><pubDate>Sat, 05 Nov 2011 18:36:00 +0000</pubDate><atom:updated>2013-01-11T07:46:49.599-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">html php insertar tabla dinamica manualmente</category><title>Ingresar datos en una Tabla Dinámica de Forma Manual. (html y php)</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Quiero empezar con este blog, con un aporte que me acaba de servir mucho. Agradecimientos a las personas que me ayudaron con esto.&lt;br /&gt;
&lt;br /&gt;
Para empezar, en lenguaje html, vamos a entender &lt;b&gt;una tabla dinámica &lt;/b&gt;como una tabla, cuya cantidad de filas no se puede precisar. O sea que no se sabe cuantas filas va tener, y por lo tanto se utiliza el &lt;a href=&quot;http://es.wikipedia.org/wiki/PHP&quot;&gt;lenguaje php&lt;/a&gt; o algún otro lenguaje de programación orientado a web, para ir insertando las filas, normalmente usando un ciclo FOR u otro ciclo repetitivo.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Existen una serie de tutoriales en internet en donde nos explican como crear una tabla dinámica a partir de datos almacenados en una base de datos. Por ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.youtube.com/watch?v=KRU4gb2NBWo&quot;&gt;Video para crear tablas dinamicas usando php&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
En mi caso, yo pretendo crear una tabla dinámica, cuyos datos sean ingresados manualmente por medio de campos de texto o etiquetas &amp;lt;input&amp;gt; y mediante un botón sean añadidos a la tabla.&lt;br /&gt;
&lt;br /&gt;
Así que manos a la obra, inicialmente tenemos el siguiente formulario:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;PRUEBA&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;form name=&quot;alumno&quot; method=&quot;post&quot; action=&quot;&amp;lt;?php $PHP_SELF ?&amp;gt;&quot;&amp;gt;&lt;br /&gt;
&amp;lt;label&amp;gt;Nombre:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;text&quot; size=&quot;25&quot; maxlength=&quot;50&quot; name=&quot;nombre&quot;&amp;gt;&lt;br /&gt;
&amp;lt;label&amp;gt;Edad:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;number&quot; name=&quot;edad&quot;&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;submit&quot; value=&quot;Anadir&quot;&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;table border=&quot;1&quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Nombre:&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Edad:&amp;lt;/th&amp;gt;    &lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Con este código obtenemos un formulario muy básico, que consta de dos campos de texto, un bóton que nos va servir para añadir los datos a la tabla, la cual está debajo de los campos.&lt;br /&gt;
&lt;br /&gt;
Bien, lo primero que vamos a hacer es añadir una etiqueta input de tipo &quot;hidden&quot; al formulario, este nos va servir para indicarle a php, que estamos añadiendo registros a la tabla. Lo colocamos entonces dentro del formulario así:&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;form name=&quot;alumno&quot; method=&quot;post&quot; action=&quot;index1.php&quot;&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;hidden&quot; value=&quot;anadir&quot; name=&quot;accion&quot;&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora lo que sigue es añadir el código PHP que se va encargar de hacer la magia. Lo que tenemos que hacer es comprobar el valor que tiene &quot;accion&quot; (o sea la etiqueta input que acabamos de añadir) y dependiendo de eso, así va ser la acción que se va realizar. Por ejemplo si &quot;acción&quot; es igual a &quot; &quot; o está vacío, quiere decir que es la primera vez que la página se carga, por tanto es buen momento para crear una variable &quot;contador&quot; que se encargue de controlar la posición de una matriz &quot;datos&quot; que vamos a usar para almacenar los registros que se van a mostrar en la tabla. Cabe mencionar que estas variables &quot;contador&quot; y &quot;datos&quot; deben ser variable de sesión, para que al recargar la página no se pierdan los datos. La porción de código a añadir sería la siguiente: (Añadir al principio del código)&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;?php&lt;br /&gt;
session_start();&lt;br /&gt;
if($_POST[&#39;accion&#39;]==&quot;&quot;) {&lt;br /&gt;
$_SESSION[&#39;contador&#39;]=0;&lt;br /&gt;
}&lt;br /&gt;
if($_POST[&#39;accion&#39;]==&quot;anadir&quot;) {&lt;br /&gt;
$_SESSION[&#39;datos&#39;][$_SESSION[&#39;contador&#39;]][0]=$_POST[&#39;nombre&#39;];&lt;br /&gt;
$_SESSION[&#39;datos&#39;][$_SESSION[&#39;contador&#39;]][1]=$_POST[&#39;edad&#39;];&lt;br /&gt;
$_SESSION[&#39;contador&#39;]=$_SESSION[&#39;contador&#39;]+1;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Usamos &lt;i&gt;session_start() &lt;/i&gt;para recuperar las variables de sesión, luego se comprueba el valor de &lt;i&gt;accion. &lt;/i&gt;Cuando está vacío quiero decir que es la primera vez que se carga la página, por lo que se crea el &lt;i&gt;contador&lt;/i&gt; que va manejar las posiciones de la matriz &lt;i&gt;datos &lt;/i&gt;donde están almacenados los registros que se van a mostrar en la tabla. Cuando &lt;i&gt;accion &lt;/i&gt;tiene el valor de &quot;anadir&quot;, quiero decir que ya se presionó por lo menos una vez el botón &lt;i&gt;Añadir &lt;/i&gt;y por tanto ya hay un dato que se debe mostrar. Estos datos se almacenan en la matriz &lt;i&gt;datos &lt;/i&gt;y se aumenta en uno el contador&lt;i&gt;.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Ahora solo resta mostrar los registros en la tabla, y para ello solo basta con recorrer la matriz e ir mostrando los datos que contiene. Así:&lt;i&gt; &lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&amp;lt;table border=&quot;1&quot;&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Nombre:&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;th&amp;gt;Edad:&amp;lt;/th&amp;gt; &lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
for($i=0;$i&amp;lt;$_SESSION[&#39;contador&#39;];$i++) {&lt;br /&gt;
echo &quot;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&quot;.$_SESSION[&#39;datos&#39;][$i][0].&quot;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;td&amp;gt;&quot;.$_SESSION[&#39;datos&#39;][$i][1].&quot;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
De esta manera tenemos una tabla a la que se le pueden insertar registros de forma manual. Si luego se desea almacenar estos datos en una base de datos solo se debe trabajar con la matriz. Posteo tambien el archivo php con el código completo. Si le has gustado este post comenten :)&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://ubuntuone.com/3rGKicfpNl5ENNrv3LTB6p&quot;&gt;Descargar arhivo php&lt;/a&gt;</description><link>http://mipedacitodeinternet.blogspot.com/2011/11/ingresar-datos-en-una-tabla-dinamica-de.html</link><author>noreply@blogger.com (Anonymous)</author><thr:total>14</thr:total></item></channel></rss>