<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Smultron POTENCIA !! &#187; Resultados de la búsqueda  &#187;  +2009+09+page+3</title>
	<atom:link href="http://smultron.es/search/+2009+09+page+3/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://smultron.es</link>
	<description>El Blog con Potencia pero sin Control.</description>
	<lastBuildDate>Sat, 11 Feb 2012 18:52:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Descargar Paginas Web Usando PHP &#8211; cURL &#8211; file_get_contents</title>
		<link>http://smultron.es/2011/02/descargar-paginas-web-usando-php-curl-file_get_contents/</link>
		<comments>http://smultron.es/2011/02/descargar-paginas-web-usando-php-curl-file_get_contents/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 23:35:37 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programacion]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4943</guid>
		<description><![CDATA[&#160;Via:&#160;www.forosdelweb.com/wiki/PHP:_file_get_contents(),_cURL,_HTTP_Request En ForosDelWeb he encontrado varias maneras de descargar paginas web utilizando PHP. Definiciones file_get_contents() cURL HTTP_Request Introducci&#243;n Hay varias maneras de mostrar un URL remoto en PHP. La elecci&#243;n de un m&#233;todo sobre otro depende de las necesidades de su simplicidad, control y portabilidad. Los tres m&#233;todos que vamos a describir son: Las funciones [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;Via:&nbsp;<a target="_blank" href="http://www.forosdelweb.com/wiki/PHP:_file_get_contents(),_cURL,_HTTP_Request">www.forosdelweb.com/wiki/PHP:_file_get_contents(),_cURL,_HTTP_Request</a></p>
<p>En ForosDelWeb he encontrado varias maneras de descargar paginas web utilizando PHP.</p>
<p><span id="more-4943"></span><br />
<meta charset="utf-8" /><span class="Apple-style-span" style="font-family: sans-serif; font-size: 13px; line-height: 19px; "></p>
<h2 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170); font-size: 23px; padding-top: 0.6em; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Definiciones</span></h2>
<ul style="line-height: 1.5em; list-style-type: square; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: url(http://www.forosdelweb.com/w/skins/monobook/bullet.gif); ">
<li style="margin-bottom: 0.3em; "><a href="http://php.net/file_get_contents" class="external text" title="http://php.net/file_get_contents" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">file_get_contents()</a></li>
<li style="margin-bottom: 0.3em; "><a href="http://php.net/manual/en/intro.curl.php" class="external text" title="http://php.net/manual/en/intro.curl.php" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">cURL</a></li>
<li style="margin-bottom: 0.3em; "><a href="http://pear.php.net/manual/en/package.http.http-request.php" class="external text" title="http://pear.php.net/manual/en/package.http.http-request.php" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">HTTP_Request</a></li>
</ul>
<p><a name="Introducci.C3.B3n" id="Introducci.C3.B3n" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h2 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170); font-size: 23px; padding-top: 0.6em; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Introducci&oacute;n</span></h2>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Hay varias maneras de mostrar un URL remoto en PHP. La elecci&oacute;n de un m&eacute;todo sobre otro depende de las necesidades de su simplicidad, control y portabilidad. Los tres m&eacute;todos que vamos a describir son:</p>
<ul style="line-height: 1.5em; list-style-type: square; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: url(http://www.forosdelweb.com/w/skins/monobook/bullet.gif); ">
<li style="margin-bottom: 0.3em; ">Las funciones estandares de &quot;<b>filesystem</b>&quot;</li>
<li style="margin-bottom: 0.3em; ">La extensi&oacute;n&nbsp;<b>cURL</b></li>
<li style="margin-bottom: 0.3em; ">La clase de PEAR&nbsp;<b>HTTP_Request</b>.</li>
</ul>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Estos tres m&eacute;todos pueden generalmente hacer todo lo que necesita y por lo menos uno de ellos deben estar disponibles, sea cual sea su configuraci&oacute;n del servidor o capacidad de instalar las extensiones personalizadas. Otras formas de recuperar las URL remotas incluye la extesi&oacute;n pecl_http (<a href="http://pecl.php.net/package/pecl_http" class="external free" title="http://pecl.php.net/package/pecl_http" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">http://pecl.php.net/package/pecl_http</a>), que, aunque todav&iacute;a en desarrollo, ofrece algunas caracter&iacute;sticas prometedoras, y utilizando el&nbsp;<b>fsockopen()</b>&nbsp;para abrir un z&oacute;calo sobre el que env&iacute;a una petici&oacute;n HTTP que lo construye pieza por pieza.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">El uso de las funciones estandares de &quot;<b>filesystem</b>&quot; como la funci&oacute;n<b>file_get_contents()</b>&nbsp;es simple y conveniente. Sigue automaticamente las redirecciones, as&iacute; que si utiliza esta funci&oacute;n para recuperar el directorio<i><b>http://www.example.com/persona/</b></i>&nbsp;y el servidor le redirecciona a<i><b>http://www.example.com/people/</b></i>, obtendr&aacute; el contenido de la p&aacute;gina de &iacute;ndice de directorio, no un mensaje que le diga que la URL ha cambiado de direcci&oacute;n. El inconveniente de este m&eacute;todo es que requiere la directiva de configuraci&oacute;n<b>allow_url_fopen</b>&nbsp;a estar activado.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">La extensi&oacute;n&nbsp;<b>CURL</b>&nbsp;es una poderosa herramienta. Se basa en el popular&nbsp;<a href="http://curl.haxx.se/" class="external text" title="http://curl.haxx.se/" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">libcurl</a>&nbsp;para proporcionar un r&aacute;pido, configurable mecanismo para el manejo de una amplia variedad de peticiones de red. Si esta extensi&oacute;n est&aacute; disponible en su servidor, le recomendamos que la utilice.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Si se desactiva&nbsp;<b>allow_url_fopen</b>&nbsp;y&nbsp;<b>cURL</b>&nbsp;no est&aacute; disponible, el m&oacute;dulo PEAR<b>HTTP_Request</b>&nbsp;salva el d&iacute;a. Al igual que todos los m&oacute;dulos de PEAR, es puro PHP, por lo que si puede guardar un archivo PHP en su servidor, puede utilizarlo.<b>HTTP_Request</b>&nbsp;soporta casi cualquier cosa que te gustar&iacute;a hacer cuando se solicite una URL remota, incluyendo la modificaci&oacute;n de cabeceras de petici&oacute;n y el cuerpo, utilizando un m&eacute;todo arbitrario, respuesta y recuperaci&oacute;n de los encabezados. Para mas informacion sobre como instalar los modulo de PEAR puedes ir a<a href="http://pear.php.net/manual/en/installation.getting.php" class="external free" title="http://pear.php.net/manual/en/installation.getting.php" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">http://pear.php.net/manual/en/installation.getting.php</a></p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Para recibir informaci&oacute;n de URL seguras, solo escribe https en vez de http. Siempre y cuando en PHP haya sido construido en una libreria SSL, tal como&nbsp;<i>OpenSSL</i>. Todas las funciones que pueden recibir informaci&oacute;n de URL regulares pueden recibir informaci&oacute;n de URL seguras. Verifica la secci&oacute;n de&nbsp;<i>OpenSSL</i>&nbsp;en la salida de&nbsp;<b>phpinfo()</b>&nbsp;para ver si tu configuraci&oacute;n de php tiene soporte de SSL.</p>
<p><a name="Ejemplos" id="Ejemplos" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h2 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.6em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170); font-size: 23px; padding-top: 0.6em; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Ejemplos</span></h2>
<p><a name="Obteniendo_una_URL" id="Obteniendo_una_URL" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Obteniendo una URL</span></h3>
<p><a name="file_get_contents.28.29" id="file_get_contents.28.29" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/algo.txt'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="cURL" id="cURL" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/algo.txt'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Request" id="HTTP_Request" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Request</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="kw1" style="color: rgb(177, 177, 0); ">require_once</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'HTTP/Request.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Request<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/algo.txt'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">sendRequest</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">getResponseBody</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Mostrar_una_p.C3.A1gina_protegida" id="Mostrar_una_p.C3.A1gina_protegida" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Mostrar una p&aacute;gina protegida</span></h3>
<p><a name="file_get_contents.28.29_2" id="file_get_contents.28.29_2" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://FDW:PASS@www.example.com/proyecto.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="cURL_2" id="cURL_2" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/proyecto.php'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_USERPWD<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'FDW:PASS'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Request_2" id="HTTP_Request_2" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Request</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Request<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/proyecto.php'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">setBasicAuth</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'FDW'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span><span class="st_h" style="color: rgb(0, 0, 255); ">'PASS'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">sendRequest</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">getResponseBody</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Usar_el_metodo_de_POST" id="Usar_el_metodo_de_POST" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Usar el metodo de POST</span></h3>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Enviar por el m&eacute;todo de POST requiere de manejo especial en cada argumento. Con el m&eacute;todo de GET, estos argumentos est&aacute;n en la cadena de consulta, pero en un POST van en la solicitud cuerpo. Adem&aacute;s, la solicitud necesita una cabecera Content-Length que le dice al servidor el tama&ntilde;o del contenido a esperar en la solicitud cuerpo.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Mostrar una direcci&oacute;n URL con el m&eacute;todo de POST en vez del metdo de GET es bien &uacute;til cuando la cadena es muy larga, m&aacute;s de 200 caracteres aproximadamente. La especificaci&oacute;n de HTTP 1.1 en el&nbsp;<a href="http://tools.ietf.org/html/rfc2616" class="external text" title="http://tools.ietf.org/html/rfc2616" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">RFC 2616</a>&nbsp;no impone una longitud m&aacute;xima en las URL, por lo que el comportamiento var&iacute;a entre las diferentes web y servidores proxy. Si al mostrar las URL con GET y recibes resultados inesperados o resultados con el c&oacute;digo de estado 414 ( &quot;<i><b>Request-URI Too Long</b></i>&quot;), convierte la solicitud al m&eacute;todo de POST.</p>
<p><a name="file_get_contents.28.29_3" id="file_get_contents.28.29_3" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/submit.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$body</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'FDW=programacion&amp;PHP=f18'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$options</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'method'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'POST'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'content'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="re0" style="color: rgb(0, 0, 136); ">$body</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$context</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/stream_context_create" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">stream_context_create</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="re0" style="color: rgb(0, 0, 136); ">$options</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">false</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$context</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="cURL_3" id="cURL_3" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/submit.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$body</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'FDW=programacion&amp;PHP=f18'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_POST<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_POSTFIELDS<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$body</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Request_3" id="HTTP_Request_3" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Request</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="kw1" style="color: rgb(177, 177, 0); ">require</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'HTTP/Request.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/submit.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Request<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">setMethod</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span>HTTP_REQUEST_METHOD_POST<span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">addPostData</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'FDW'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span><span class="st_h" style="color: rgb(0, 0, 255); ">'programacion'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">addPostData</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'PHP'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span><span class="st_h" style="color: rgb(0, 0, 255); ">'f18'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">sendRequest</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">getResponseBody</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Enviar_cookies" id="Enviar_cookies" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Enviar cookies</span></h3>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Las cookies se env&iacute;an al servidor en el encabezado de solicitud de cookies. La extensi&oacute;n cURL tiene una opci&oacute;n espec&iacute;fica en cookies, pero con HTTP_Request, tienes que agregar el encabezado de cookies al igual que con otras cabeceras de petici&oacute;n. Los valores de Cookie m&uacute;ltiples se env&iacute;an en una lista delimitada por coma. En los ejemplos vamos a enviar dos cookies: una con el nombre de user y con el valor FDW y otra con el nombre de actividad y con el valor de programacion.</p>
<p><a name="file_get_contents.28.29_4" id="file_get_contents.28.29_4" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$options</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span>
    <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span>
        <span class="st_h" style="color: rgb(0, 0, 255); ">'method'</span>  <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'GET'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span>
        <span class="st_h" style="color: rgb(0, 0, 255); ">'header'</span>  <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'Content-type: text/plain;charset=UTF-8\r\n'</span><span class="sy0" style="color: rgb(51, 153, 51); ">.</span>
        <span class="st_h" style="color: rgb(0, 0, 255); ">'Referer: http://www.forosdelweb.com\r\n'</span><span class="sy0" style="color: rgb(51, 153, 51); ">.</span>
        <span class="st_h" style="color: rgb(0, 0, 255); ">'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6\r\n'</span><span class="sy0" style="color: rgb(51, 153, 51); ">.</span>
        <span class="st_h" style="color: rgb(0, 0, 255); ">'Cookie: user=FDW; actividad=programacion;\r\n'</span>
    <span class="br0" style="color: rgb(0, 153, 0); ">)</span>
<span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$context</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/stream_context_create" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">stream_context_create</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$options</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/enviar-cookies.php'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">false</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$context</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="cURL_4" id="cURL_4" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/enviar-cookies.php'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_COOKIE<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'user=FDW; actividad=programacion'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Request_4" id="HTTP_Request_4" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Request</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="kw1" style="color: rgb(177, 177, 0); ">require</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'HTTP/Request.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Request<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/enviar-cookies.php'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">addHeader</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'Cookie'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span><span class="st_h" style="color: rgb(0, 0, 255); ">'user=FDW; actividad=programacion'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">sendRequest</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">getResponseBody</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Seguir_redireccionamientos" id="Seguir_redireccionamientos" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Seguir redireccionamientos</span></h3>
<p><a name="file_get_contents.28.29_5" id="file_get_contents.28.29_5" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; "><i><b>Nota:</b></i>&nbsp;El&nbsp;<b>file_get_contents()</b>&nbsp;sigue autom&aacute;ticamente las redirecciones (<i>header(&quot;Location: redireccion.php&quot;)</i>).</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/redireccionar.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="cURL_5" id="cURL_5" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/redireccionar.php'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_FOLLOWLOCATION<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Client" id="HTTP_Client" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Client</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; "><i><b>Nota:</b></i>&nbsp;<b>HTTP_request</b>&nbsp;no sigue las redirecciones, pero el m&oacute;dulo de PEAR&nbsp;<b>HTTP_Client</b>&nbsp;logra lo que queremos</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/redireccionar.php'</span>;
<span class="kw1" style="color: rgb(177, 177, 0); ">require_once</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'HTTP/Client.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$client</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Client<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$client</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">get</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$client</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">currentResponse</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span><span class="br0" style="color: rgb(0, 153, 0); ">[</span><span class="st_h" style="color: rgb(0, 0, 255); ">'body'</span><span class="br0" style="color: rgb(0, 153, 0); ">]</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="No_seguir_redirecciones" id="No_seguir_redirecciones" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">No seguir redirecciones</span></h3>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Como hemos indicado anteriormente el&nbsp;<b>file_get_contents()</b>&nbsp;sigue autom&aacute;ticamente las redirecciones (<i>header(&quot;Location: redireccion.php&quot;)</i>). A partir de PHP 5.0.0,&nbsp;<b>file_get_contents()</b>&nbsp;y&nbsp;<b>fopen()</b>&nbsp;nos da unas opciones especificas acerca de como obtener el stream. En PHP 5.1.0 y posteriores, una de esas opciones es<b>max_redirects</b>&nbsp;el n&uacute;mero m&aacute;ximo de redirecciones a seguir. Si indicamos el&nbsp;<b>max_redirects</b>&nbsp;a 0 o 1, solo hace una solicitud.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">El&nbsp;<b>max_redirects</b>&nbsp;realmente no indica el n&uacute;mero de redirecciones deben seguirse, pero el n&uacute;mero m&aacute;ximo de solicitudes que deben efectuarse en el momento siguiente a la cadena de redireccionamiento. Es decir, un valor de 1 le dice a PHP que al menos una solicitud debe seguir, y no un redireccionamiento. Un valor de 2 le dice a PHP para que al menos de 2 solicitudes deben seguir y no m&aacute;s de 1 redireccionamiento. Un valor de 0, sin embargo, se comporta como un valor de 1, PHP hace s&oacute;lo 1 solicitud.</p>
<p><a name="file_get_contents.28.29_6" id="file_get_contents.28.29_6" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/redireccionar.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$options</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'max_redirects'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="nu0" style="color: rgb(204, 102, 204); ">1</span> <span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$context</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/stream_context_create" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">stream_context_create</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="re0" style="color: rgb(0, 0, 136); ">$options</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">false</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$context</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>; </pre>
<p><a name="cURL_6" id="cURL_6" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; "><i><b>Nota:</b></i>&nbsp;Para no seguir las redirecciones no uses&nbsp;<b>CURLOPT_FOLLOWLOCATION</b></p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/redireccionar.php'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Request_5" id="HTTP_Request_5" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Request</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; "><i><b>Nota:</b></i>&nbsp;<b>HTTP_Request</b>&nbsp;no sigue redirecciones</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="kw1" style="color: rgb(177, 177, 0); ">require_once</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'HTTP/Request.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Request<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/redireccionar.php'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">sendRequest</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">getResponseBody</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Configurar_tiempo_limite" id="Configurar_tiempo_limite" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Configurar tiempo limite</span></h3>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Si quieres obtener una URL remota, pero no quieres esperar demasiado tiempo si el servidor remoto est&aacute; ocupado o lento.</p>
<p><a name="file_get_contents.28.29_7" id="file_get_contents.28.29_7" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; "><i><b>Nota:</b></i>&nbsp;Estableceremos el tiempo limite a 15 segundos</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<a href="http://www.php.net/ini_set" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">ini_set</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'default_socket_timeout'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="nu0" style="color: rgb(204, 102, 204); ">15</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://slow.example.com/'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;</pre>
<p><a name="cURL_7" id="cURL_7" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; "><i><b>Nota:</b></i>&nbsp;Estableceremos el tiempo limite a 15 segundos</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://slow.example.com/'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_CONNECTTIMEOUT<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="nu0" style="color: rgb(204, 102, 204); ">15</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Request_6" id="HTTP_Request_6" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Request</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; "><i><b>Nota:</b></i>&nbsp;Estableceremos el tiempo limite a 15 segundos</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="kw1" style="color: rgb(177, 177, 0); ">require_once</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'HTTP/Request.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$opts</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'timeout'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="nu0" style="color: rgb(204, 102, 204); ">15</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Request<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://slow.example.com/'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$opts</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">sendRequest</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Configurar_el_tiempo_de_leer" id="Configurar_el_tiempo_de_leer" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Configurar el tiempo de leer</span></h3>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Si dependes de un servicio remoto, puede estar funcionando y en marcha, pero no estara en condiciones de manejar sus pedidos debido a problemas de red entre tu servidor y el servidor remoto. Limitar la cantidad de tiempo que espera de PHP para conectar a un servidor remoto es una buena idea, si se utilizan datos procedentes de fuentes remotas que sea parte del proceso de construcci&oacute;n de la p&aacute;gina.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Todas las t&eacute;cnicas que describiremos limita la cantidad de tiempo de espera de PHP para conectar a un servidor remoto. Si estas realmente preocupado por las respuestas r&aacute;pidas, adicionalmente configura el l&iacute;mite de cu&aacute;nto tiempo PHP espera recibir los datos de los z&oacute;calos conectados. Para una conexi&oacute;n stream, utilice la funci&oacute;n de [B]stream_set_timeout()[/B]. Para esta funci&oacute;n necesitas abrir un stream con [B]fopen()[/B] y no con [B]file_get_contents()[/B]. En los ejemplo limitaremos el tiempo de leer a 20 segundos.</p>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Aunque el establecimiento de conexi&oacute;n y los tiempos de lectura puede mejorar el rendimiento, tambi&eacute;n puede dar lugar a respuestas ilegibles. La secuencia de comandos puede leer s&oacute;lo una respuesta parcial ante un tiempo de expiraci&oacute;n. Si ha establecido los tiempos, aseg&uacute;rese de validar toda la respuesta que ha recibido. Por otra parte, en situaciones en las que la generaci&oacute;n de la p&aacute;gina r&aacute;pido es fundamental, puedes recuperar los datos externos en un proceso separado y escribir a una memoria cach&eacute; local. De esta forma, sus p&aacute;ginas pueden usar el cach&eacute;, sin temor a l&iacute;mites de tiempo o respuestas parciales.</p>
<p><a name="fopen.28.29" id="fopen.28.29" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">fopen()</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://slow.example.com'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$stream</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/fopen" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">fopen</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'r'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/stream_set_timeout" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">stream_set_timeout</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$stream</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="nu0" style="color: rgb(204, 102, 204); ">20</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> stream_get_contents<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$stream</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/fclose" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">fclose</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$stream</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="cURL_8" id="cURL_8" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$c</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://slow.example.com/'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_CONNECTTIMEOUT<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="nu0" style="color: rgb(204, 102, 204); ">15</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_TIMEOUT<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="nu0" style="color: rgb(204, 102, 204); ">20</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_close<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$c</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p><a name="HTTP_Request_7" id="HTTP_Request_7" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">HTTP_Request</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="kw1" style="color: rgb(177, 177, 0); ">require_once</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'HTTP/Request.php'</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$opts</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'readTimeout'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="nu0" style="color: rgb(204, 102, 204); ">20</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span><span class="nu19" style="color: rgb(128, 0, 128); ">0</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$r</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">new</span> HTTP_Request<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'http://slow.example.com/'</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$opts</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="re0" style="color: rgb(0, 0, 136); ">$r</span><span class="sy0" style="color: rgb(51, 153, 51); ">-&gt;</span><span class="me1" style="color: rgb(0, 64, 0); ">sendRequest</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<a href="http://www.php.net/echo" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">echo</span></a> <span class="re0" style="color: rgb(0, 0, 136); ">$page</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Otro_m.C3.A9todo_para_incluir_las_variables_y_valores_en_la_consulta" id="Otro_m.C3.A9todo_para_incluir_las_variables_y_valores_en_la_consulta" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Otro m&eacute;todo para incluir las variables y valores en la consulta</span></h3>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">Haciendo uso de&nbsp;<a href="http://www.php.net/http_build_query" class="external text" title="http://www.php.net/http_build_query" rel="nofollow" style="text-decoration: none; color: rgb(51, 102, 187); background-image: url(http://www.forosdelweb.com/w/skins/monobook/external.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 13px; background-position: 100% 50%; background-repeat: no-repeat no-repeat; ">http_build_query()</a>&nbsp;puedes mostrar una p&aacute;gina incluyendo las variables con sus respectivos valores en la consulta. Se acepta una serie de clave/valor en pares y devuelve una &uacute;nica cadena con todo escapado correctamente. Tu eres responsable del s&iacute;mbolo de&nbsp;? en el URL para establecer la consulta.</p>
<p><a name="file_get_contents" id="file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$vars</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="st_h" style="color: rgb(0, 0, 255); ">'FDW'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="nu0" style="color: rgb(204, 102, 204); ">4</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'Programaci&oacute;n'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'PHP &amp; f18'</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$qs</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> http_build_query<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$vars</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/search.php?'</span> <span class="sy0" style="color: rgb(51, 153, 51); ">.</span> <span class="re0" style="color: rgb(0, 0, 136); ">$qs</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;</pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Bajar_archivos" id="Bajar_archivos" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Bajar archivos</span></h3>
<p><a name="file_get_contents_2" id="file_get_contents_2" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">file_get_contents</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st0" style="color: rgb(0, 0, 255); ">&quot;http://www.example.com/zip.zip&quot;</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$g</span><span class="sy0" style="color: rgb(51, 153, 51); ">=</span><a href="http://www.php.net/basename" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">basename</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$content</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/file_get_contents" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">file_get_contents</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
file_put_contents<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$g</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span><span class="re0" style="color: rgb(0, 0, 136); ">$content</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;</pre>
<p><a name="cURL_9" id="cURL_9" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h5 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: black; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 17px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h5>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$url</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <span class="st_h" style="color: rgb(0, 0, 255); ">'http://www.example.com/hola.zip'</span>;
&nbsp;
<span class="re0" style="color: rgb(0, 0, 136); ">$g</span><span class="sy0" style="color: rgb(51, 153, 51); ">=</span><a href="http://www.php.net/basename" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">basename</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
&nbsp;
<span class="kw1" style="color: rgb(177, 177, 0); ">if</span><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="sy0" style="color: rgb(51, 153, 51); ">!</span><a href="http://www.php.net/is_file" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">is_file</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$g</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span><span class="br0" style="color: rgb(0, 153, 0); ">{</span>
    <span class="re0" style="color: rgb(0, 0, 136); ">$fp</span><span class="sy0" style="color: rgb(51, 153, 51); ">=</span><a href="http://www.php.net/fopen" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">fopen</span></a> <span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$g</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="st0" style="color: rgb(0, 0, 255); ">&quot;w&quot;</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
&nbsp;
    <span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="sy0" style="color: rgb(51, 153, 51); ">=</span>curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$url</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
    curl_setopt <span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span>CURLOPT_FILE<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$fp</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
    curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span>CURLOPT_CONNECTTIMEOUT<span class="sy0" style="color: rgb(51, 153, 51); ">,</span><span class="nu0" style="color: rgb(204, 102, 204); ">60</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
    curl_exec <span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
    curl_close <span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
&nbsp;
    <a href="http://www.php.net/fclose" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">fclose</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$fp</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="br0" style="color: rgb(0, 153, 0); ">}</span></pre>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<p><a name="Subir_archivos" id="Subir_archivos" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h3 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 21px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">Subir archivos</span></h3>
<p><a name="cURL_10" id="cURL_10" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "></a></p>
<h4 style="font-family: 'Lucida Grande', Verdana, Arial, sans-serif; letter-spacing: -1px; font-weight: bold; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0.3em; margin-left: 0px; padding-bottom: 0.17em; border-bottom-width: initial; border-bottom-style: none; border-bottom-color: initial; font-size: 18px; background-position: initial initial; background-repeat: initial initial; "><span class="mw-headline">cURL</span></h4>
<p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; font-size: 1.1em; ">&nbsp;</p>
<pre class="php code" style="padding-top: 1em; padding-right: 1em; padding-bottom: 1em; padding-left: 1em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: dashed; border-right-style: dashed; border-bottom-style: dashed; border-left-style: dashed; border-top-color: rgb(47, 111, 171); border-right-color: rgb(47, 111, 171); border-bottom-color: rgb(47, 111, 171); border-left-color: rgb(47, 111, 171); color: black; background-color: rgb(238, 238, 238); line-height: 1.1em; overflow-x: scroll; overflow-y: scroll; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">&lt;?php</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$ch</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_init<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_URL<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="st0" style="color: rgb(0, 0, 255); ">&quot;http://example.com/send_file.php&quot;</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_RETURNTRANSFER<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_POST<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="kw2" style="color: rgb(0, 0, 0); font-weight: bold; ">true</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="co1" style="color: rgb(102, 102, 102); font-style: italic; ">// lo mismo que &lt;input type=&quot;file&quot; name=&quot;nombre_del_input&quot; /&gt;</span>
<span class="re0" style="color: rgb(0, 0, 136); ">$post</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> <a href="http://www.php.net/array" style="text-decoration: none; color: rgb(0, 43, 184); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; "><span class="kw3" style="color: rgb(153, 0, 0); ">array</span></a><span class="br0" style="color: rgb(0, 153, 0); ">(</span>
    <span class="st0" style="color: rgb(0, 0, 255); ">&quot;nombre_del_input&quot;</span><span class="sy0" style="color: rgb(51, 153, 51); ">=&gt;</span><span class="st0" style="color: rgb(0, 0, 255); ">&quot;@C:/directorio/hacia/el/archivo.jpg&quot;</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span>
<span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
curl_setopt<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="sy0" style="color: rgb(51, 153, 51); ">,</span> CURLOPT_POSTFIELDS<span class="sy0" style="color: rgb(51, 153, 51); ">,</span> <span class="re0" style="color: rgb(0, 0, 136); ">$post</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;
<span class="re0" style="color: rgb(0, 0, 136); ">$page</span> <span class="sy0" style="color: rgb(51, 153, 51); ">=</span> curl_exec<span class="br0" style="color: rgb(0, 153, 0); ">(</span><span class="re0" style="color: rgb(0, 0, 136); ">$ch</span><span class="br0" style="color: rgb(0, 153, 0); ">)</span>;</pre>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2011/02/descargar-paginas-web-usando-php-curl-file_get_contents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Revista</title>
		<link>http://smultron.es/revista-coleopteros/</link>
		<comments>http://smultron.es/revista-coleopteros/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 23:54:11 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://smultron.es/?page_id=4684</guid>
		<description><![CDATA[&#160; Tengo la grata oportunidad de informar que la revista de la Facultad de Inform&#225;tica &#8211; UPM conocida como COLE&#211;PTEROS ha sido adquirida por el Proyecto Smultron. La historia de esta revista se remonta a principios de los a&#241;os 90, y su trayectoria se conmemora hasta finales de 2009, cuando el Proyecto Smultron adopta esta [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://smultron.es/images/titulo-coleopteros.jpg" alt="Revista Coleopteros" /></p>
<p>&nbsp;</p>
<p>Tengo la grata oportunidad de informar que la revista de la <a target="_blank" href="http://www.fi.upm.es"><strong><em>Facultad de Inform&aacute;tica &#8211; UPM</em></strong></a> conocida como <a href="http://coleopteros.smultron.es">COLE&Oacute;PTEROS</a> ha sido adquirida por el<strong> Proyecto Smultron.</strong></p>
<p>La historia de esta revista se remonta a principios de los a&ntilde;os 90, y su trayectoria se conmemora hasta finales de 2009, cuando el Proyecto Smultron adopta esta herramienta como medio de comunicaci&oacute;n y la impulsa para que pase de informar a un grupo reducido de alumnos, a informar a TODO EL MUNDO, compaginando una edici&oacute;n online junto a una edici&oacute;n tradicional.</p>
<p>&nbsp;</p>
<p style="text-align: center;">COLABORADORES | PATROCINADORES | LECTORES | TODO EL MUNDO</p>
<p style="text-align: center;"><span style="font-size: larger;"><a href="javascript:location.href='mailto:'+String.fromCharCode(115,109,117,108,116,114,111,110,112,111,116,101,110,99,105,97,64,103,109,97,105,108,46,99,111,109)+'?subject=Revista%20Smultron%20(Coleopteros)'">CONTACTA !!</a></span></p>
<p>&nbsp;</p>
<p>Aqu&iacute; podeis ver un par de n&uacute;meros de esta exitosa revista.</p>
<p>&nbsp;</p>
<h2>Numeros Anteriores.</h2>
<div style="text-align: center;">
<div style="font-weight: bold;"><a href="http://es.calameo.com/read/00014039476b2f2b70e36">Coleopteros Junio 2009 &#8211; Proyecto Smultron</a></div>
<div style="padding-top: 8px;"><object width="100%" id="00014039476b2f2b70e36" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="movie" value="http://v.calameo.com/2.0/cmini.swf?bkcode=00014039476b2f2b70e36&amp;langid=es&amp;clickTo=public&amp;clickTarget=_blank&amp;autoFlip=0&amp;showArrows=1&amp;page=1" /><param name="scale" value="noscale" /><param name="loop" value="false" /><param name="salign" value="t" /><param name="allowScriptAccess" value="always" /><param name="wmode" value="transparent" /><embed src="http://v.calameo.com/2.0/cmini.swf" type="application/x-shockwave-flash" scale="noscale" allowscriptaccess="always" loop="false" salign="t" wmode="transparent" style="width: 100%;" flashvars="bkcode=00014039476b2f2b70e36&amp;langid=es&amp;clickTo=public&amp;clickTarget=_blank&amp;autoFlip=0&amp;showArrows=1&amp;page=1"></embed></object></div>
<div style="padding-top: 8px;">&nbsp;</div>
</div>
<p>
&nbsp;</p>
<div style="text-align: center;">
<div style="font-weight: bold;"><a href="http://es.calameo.com/read/0001403941848ead6c5e1">Coleopteros Abril 2008 &#8211; Proyecto Smultron</a></div>
<div style="padding-top: 8px;"><object width="100%" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="0001403941848ead6c5e1"><param value="http://v.calameo.com/2.0/cmini.swf?bkcode=0001403941848ead6c5e1&amp;langid=es&amp;clickTo=public&amp;clickTarget=_blank&amp;autoFlip=0&amp;showArrows=1&amp;page=1" name="movie" /><param value="noscale" name="scale" /><param value="false" name="loop" /><param value="t" name="salign" /><param value="always" name="allowScriptAccess" /><param value="transparent" name="wmode" /><embed flashvars="bkcode=0001403941848ead6c5e1&amp;langid=es&amp;clickTo=public&amp;clickTarget=_blank&amp;autoFlip=0&amp;showArrows=1&amp;page=1" wmode="transparent" salign="t" loop="false" allowscriptaccess="always" scale="noscale" type="application/x-shockwave-flash" src="http://v.calameo.com/2.0/cmini.swf"></embed></object></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/revista-coleopteros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invitaciones Google Wave</title>
		<link>http://smultron.es/2009/12/invitaciones-google-wave/</link>
		<comments>http://smultron.es/2009/12/invitaciones-google-wave/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 17:42:12 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4658</guid>
		<description><![CDATA[&#160;Deja un comentario y te enviaremos una invitaci&#243;n lo antes posible, Gracias. &#160; &#160; Si no conoces Spotify te aconsejo ir a http://smultron.es/spotify Hazte Fan de Smultron en FACEBOOK &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: larger;">&nbsp;Deja un comentario y<strong> te enviaremos una invitaci&oacute;n </strong>lo antes posible, Gracias.</span></p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://wave.google.com/wave/"><img alt="" src="https://www.google.com/accounts/wave/wave-logo.gif" /></a></p>
<p>&nbsp;</p>
<p style="text-align: right;"><span style="background-color: rgb(192, 192, 192);">Si no conoces <span style="color: rgb(51, 153, 102);"><strong>Spotify</strong></span> te aconsejo ir a </span> <a href="http://smultron.es/2009/02/spotify-everyone-loves-music/"><span style="background-color: rgb(192, 192, 192);">http://smultron.es/spotify</span></a></p>
<p style="text-align: right;"><a href="http://www.facebook.com/pages/Smultron/201955377199"><span style="background-color: rgb(192, 192, 192);">Hazte Fan de Smultron en FACEBOOK</span></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p style="text-align: left;"><iframe width="100%" height="auto" src="http://smultron.es/donar.php"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/12/invitaciones-google-wave/feed/</wfw:commentRss>
		<slash:comments>85</slash:comments>
		</item>
		<item>
		<title>Google Maps API &#8211; Personaliza tu mapa</title>
		<link>http://smultron.es/2009/11/google-maps-api-personaliza-tu-mapa/</link>
		<comments>http://smultron.es/2009/11/google-maps-api-personaliza-tu-mapa/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 23:39:35 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[copy&page]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Interesante]]></category>
		<category><![CDATA[Programacion]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[videotutorial]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4607</guid>
		<description><![CDATA[&#160; Copy&#38;Page: http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web (version Inglesa: http://stiern.com/tutorials/adding-custom-google-maps-to-your-website) En los sitios web de una compa&#241;&#237;a a menudo se utilizan mapas para mostrarle a los clientes d&#243;nde los pueden encontrar. Para esto, Google Maps es excelente. Pero &#191;No ser&#237;a genial a&#241;adir el logo de nuestra compa&#241;&#237;a, los estacionamientos cercanos, las estaciones de trenes, y otros datos alternativos en [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Copy&amp;Page: http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web</p>
<p>(version Inglesa: http://stiern.com/tutorials/adding-custom-google-maps-to-your-website)</p>
<p><span id="more-4607"></span>En los <strong>sitios web</strong> de una compa&ntilde;&iacute;a a menudo se utilizan <strong>mapas</strong> para mostrarle a los<strong> clientes</strong> d&oacute;nde los pueden encontrar. Para esto, <strong>Google Maps</strong> es excelente.</p>
<p>Pero &iquest;No ser&iacute;a genial<strong> a&ntilde;adir el logo</strong> de nuestra compa&ntilde;&iacute;a, los estacionamientos cercanos, las estaciones de trenes,  y otros <strong>datos alternativos</strong> en el mapa para <strong>ayudar</strong> m&aacute;s a los clientes?</p>
<p>Antes de empezar, veamos lo que vamos a crear:</p>
<div class="iframe-wrapper"><iframe frameborder="0" src="http://dl.getdropbox.com/u/32709/googlemaps/index.html" style="height: 300px; width: 500px;">Please upgrade your browser</iframe></div>
<h2>Google Maps API</h2>
<p>La API Google Maps te permite embeber mapas directamente en tu sitio web. S&oacute;lo se necesita un poco de JavaScript, y algo de CSS para embellecer. Recientemente ha sido lanzada la <a title="Google Maps API V3" href="http://code.google.com/apis/maps/documentation/v3/" target="_blank">Version 3</a> de la API Google Maps que es la que vamos a utilizar.</p>
<h2>Obteniendo las coordenadas</h2>
<p>Como seguramente no conocen las coordenadas precisas de su locaci&oacute;n, les explicaremos una forma r&aacute;pida que Google ha puesto a nuestra disposici&oacute;n para conocerlas. Cuando conoces la direcci&oacute;n exacta, puedes ingresar una URL de esta forma:</p>
<div class="igBar"><span id="lphp-1"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-1">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">http:<span style="color: rgb(255, 153, 51); font-style: italic;">//maps.google.com/maps/geo?q=1+Infinite Liip,+Cupertino,+CA+95014,+USA&amp;amp;output=csv&amp;amp;oe=utf8&amp;amp;sensor=false&amp;amp;key=your_google_maps_api_key </span></div>
</li>
</ol>
</div>
</div>
</div>
<p>Cuando ingreses esto en tu barra de direcciones, ver&aacute;s lo siguiente:</p>
<p><a title="&quot;The coordinates of Apple's head quarter in Cupertino&quot; " href="http://stiern.com/site/wp-content/everything/apple_coordinates.png"><img width="245" height="28" class="alignnone size-full wp-image-11105" src="http://www.elwebmaster.com/wp-content/uploads/2009/10/apple_coordinates.png" alt="apple_coordinates" /><br />
</a></p>
<p><em>Las coordenadas del cuartel general de Apple en Cupertino</em></p>
<p>El primer n&uacute;mero es el c&oacute;digo del estado en el que est&aacute; el punto del mapa seg&uacute;n Google, y 200 quiere decir que todo est&aacute; bien. El segundo n&uacute;mero muestra cu&aacute;n precisa es la direcci&oacute;n, en este caso el n&uacute;mero es 8, que es bastante bueno. Los &uacute;ltimos dos n&uacute;meros son latitudes y longitudes, que son los n&uacute;meros que necesitamos.</p>
<h2>A&ntilde;adiendo el mapa a tu web</h2>
<p>Abre tu editor HTML favorito y crea un archivo HTML est&aacute;ndar con codificaci&oacute;n UTF-8.</p>
<p>Primero que nada es necesario crear el puerto de visualizaci&oacute;n y decirle a nuestro archivo HTML que obtenga el archivo Javascript del c&oacute;digo Google.</p>
<p>A&ntilde;ade estas l&iacute;neas entre &lt;head&gt; y &lt;/head&gt;:</p>
<div class="igBar"><span id="lphp-2"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-2">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&lt;script src=<span style="color: rgb(255, 0, 0);">&quot;http://maps.google.com/maps/api/js?sensor=false&quot;</span> type=<span style="color: rgb(255, 0, 0);">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Luego de la URL, notar&aacute;s sensor=false. Dado que no utilizamos ning&uacute;n sensor, como un GPS, para localizar el lugar, esto se programa en false. Justo debajo de lo que hemos insertado, escriban lo siguiente:</p>
<div class="igBar"><span id="lphp-3"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&lt;script type=<span style="color: rgb(255, 0, 0);">&quot;text/javascript&quot;</span>&gt;&lt;!&#8211;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span> initialize<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">{</span></div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> latlng = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.LatLng<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">57</span>.<span style="color: rgb(128, 0, 0);">0442</span>, <span style="color: rgb(128, 0, 0);">9</span>.<span style="color: rgb(128, 0, 0);">9116</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> settings = <span style="color: rgb(0, 102, 0); font-weight: bold;">{</span></div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zoom: <span style="color: rgb(128, 0, 0);">15</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; center: latlng,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapTypeControl: <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapTypeControlOptions: <span style="color: rgb(0, 102, 0); font-weight: bold;">{</span>style: google.maps.MapTypeControlStyle.DROPDOWN_MENU<span style="color: rgb(0, 102, 0); font-weight: bold;">}</span>,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; navigationControl: <span style="color: rgb(0, 0, 0); font-weight: bold;">true</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; navigationControlOptions: <span style="color: rgb(0, 102, 0); font-weight: bold;">{</span>style: google.maps.NavigationControlStyle.SMALL<span style="color: rgb(0, 102, 0); font-weight: bold;">}</span>,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapTypeId: google.maps.MapTypeId.ROADMAP</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 102, 0); font-weight: bold;">}</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>En la l&iacute;nea 2 creamos la funci&oacute;n initialize(). Dentro de esta function vamos a definir las configuraciones b&aacute;sicas del mapa. En la l&iacute;nea 3 creamos una nueva variable, latlng. latlng que representa las latitudes y longitudes. La variable contiene las coordenadas que utilizaremos como centro de nuestro mapa.</p>
<p>Luego de esto creamos la variable settings. Aqu&iacute; tenemos muchas opciones.</p>
<ul>
<li>zoom espec&iacute;fica cu&aacute;nto zoom tundra el mapa.</li>
<li>center espec&iacute;fica nuestro centro. Al escribir latlng, nos referemos a la variable que hemos creado antes y se utilizar&aacute; la coordenada dentro de &eacute;sta.</li>
</ul>
<p>El &uacute;ltimo c&oacute;digo cambia el dise&ntilde;o del mapa para que sea un poco m&aacute;s minimalista. Los controles en la esquina superior derecha (Map, Satellite, Terrain) se cambian por un menu desplegable y los controles de navegaci&oacute;n/escalamiento en el lado izquierdo se cambiar por controles peque&ntilde;os.</p>
<p>mapTypeId: google.maps.MapTypeId.ROADMAP define que nuestro mapa debe ser del tipo ROADMAP &#8211; lo puedes cambiar por SATELLITE, HYBRID o TERRAIN.</p>
<p>Debajo del c&oacute;digo anterior, escriban esto:</p>
<div class="igBar"><span id="lphp-4"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-4">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> map = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Map<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span>document.getElementById<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(255, 0, 0);">&quot;map_canvas&quot;</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>, settings<span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Este c&oacute;digo crea la variable map, y define que el mapa debe utilizar las configuraciones que hemos creado.</p>
<p>Escriban:</p>
<div class="igBar"><span id="lphp-5"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-5">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 102, 0); font-weight: bold;">}</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;/script&gt;</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>Para terminar la funci&oacute;n, y en <code>body</code>, escriban esto:</p>
<div class="igBar"><span id="lphp-6"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&lt;body onload=<span style="color: rgb(255, 0, 0);">&quot;initialize()&quot;</span>&gt;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &lt;div id=<span style="color: rgb(255, 0, 0);">&quot;map_canvas&quot;</span> style=<span style="color: rgb(255, 0, 0);">&quot;width:800px; height:500px&quot;</span>&gt;&lt;/div&gt;</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&lt;/body&gt;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Al hacer esto le decimos a nuestro sitio que ejecute la funci&oacute;n <code>the initialize()</code> al cargar, y que inserte un <code>div</code> con el tama&ntilde;o que deseamos que tenga nuestro mapa.</p>
<h2>A&ntilde;adiendo marcadores</h2>
<p>Ahora debemos a&ntilde;adir algunos marcadores. Comencemos por crear los est&aacute;ndar y luego los personalizaremos.</p>
<p>Justo debajo de:</p>
<div class="igBar"><span id="lphp-7"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-7">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> map = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Map<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span>document.getElementById<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(255, 0, 0);">&quot;map_canvas&quot;</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>, settings<span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Inserten el siguiente c&oacute;digo:</p>
<div class="igBar"><span id="lphp-8"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> companyPos = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.LatLng<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">57</span>.<span style="color: rgb(128, 0, 0);">0442</span>, <span style="color: rgb(128, 0, 0);">9</span>.<span style="color: rgb(128, 0, 0);">9116</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> companyMarker = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Marker<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(0, 102, 0); font-weight: bold;">{</span></div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; position: companyPos,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; map: map,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; title:<span style="color: rgb(255, 0, 0);">&quot;Some title&quot;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; <span style="color: rgb(0, 102, 0); font-weight: bold;">}</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Primero, hemos creado la variable <code>companyPos</code>, donde especificamos la posici&oacute;n del marcador. Luego hemos creado al marcador en s&iacute; utilizando la variable <code>companyMarker</code>.</p>
<h2>Personalizando los marcadores</h2>
<p>Podemos hacer mucho m&aacute;s bonitos nuestros marcadores. Simplemente creemos una imagen en Photoshop con un tama&ntilde;o de 100&times;50 p&iacute;xeles, y creemos algo similar a esto:</p>
<p><img width="100" height="50" class="alignnone size-full wp-image-11106" src="http://www.elwebmaster.com/wp-content/uploads/2009/10/logo.png" alt="logo" /></p>
<p>Luego, creemos una sombra para la imagen:</p>
<p><img width="130" height="50" class="alignnone size-full wp-image-11107" src="http://www.elwebmaster.com/wp-content/uploads/2009/10/logo_shadow.png" alt="logo_shadow" /></p>
<p>Para a&ntilde;adir estas im&aacute;genes como marcadores, tenemos que cambiar el c&oacute;digo del marcador por esto:</p>
<div class="igBar"><span id="lphp-9"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-9">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> companyLogo = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.MarkerImage<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(255, 0, 0);">&#8216;images/logo.png&#8217;</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Size<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">100</span>,<span style="color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Point<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">0</span>,<span style="color: rgb(128, 0, 0);">0</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Point<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">50</span>,<span style="color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span></div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> companyShadow = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.MarkerImage<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(255, 0, 0);">&#8216;images/logo_shadow.png&#8217;</span>,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Size<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">130</span>,<span style="color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Point<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">0</span>,<span style="color: rgb(128, 0, 0);">0</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Point<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">65</span>, <span style="color: rgb(128, 0, 0);">50</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> companyPos = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.LatLng<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(128, 0, 0);">57</span>.<span style="color: rgb(128, 0, 0);">0442</span>, <span style="color: rgb(128, 0, 0);">9</span>.<span style="color: rgb(128, 0, 0);">9116</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> companyMarker = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Marker<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(0, 102, 0); font-weight: bold;">{</span></div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; position: companyPos,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; map: map,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; icon: companyLogo,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; shadow: companyShadow,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; title:<span style="color: rgb(255, 0, 0);">&quot;Company Title&quot;</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 102, 0); font-weight: bold;">}</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>La variable <code>companyImage</code> apunta al nombre de la imagen del logo. Luego define el tama&ntilde;o, origen y el tip de la imagen (d&oacute;nde estar&aacute; la imagen a&ntilde;adida a la coordenada). Luego, hacemos exactamente lo mismo para la sombra en la variable <code>companyShadow</code>. En la variable <code>companyMarker</code> a&ntilde;adimos icon y shadow, y listo.</p>
<p>Ahora, si actualizas tu sitio ver&aacute;s que el marcador ha cambiado por tu propio logo. Para a&ntilde;adir m&aacute;s marcadores, sigue simplemente el mismo m&eacute;todo, cambiando los nombres de las variables.</p>
<p>Si tienes dos marcadores muy cerca el uno del otro, quiz&aacute; debas agregar algo de <code>z-index</code>. El marcador con el <code>z-index</code> m&aacute;s alto, es el que m&aacute;s arriba est&aacute;:</p>
<p><img width="147" height="87" class="alignnone size-full wp-image-11108" src="http://www.elwebmaster.com/wp-content/uploads/2009/10/zindex.png" alt="zindex" /></p>
<p>A&ntilde;adir <code>zIndex</code> nos permite seleccionar qu&eacute; marcador debe ir arriba.</p>
<div class="igBar"><span id="lphp-10"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> companyMarker = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.Marker<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(0, 102, 0); font-weight: bold;">{</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">position: companyPos,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">map: map,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">icon: companyImage,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">shadow: companyShadow,</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">title:<span style="color: rgb(255, 0, 0);">&quot;H&oslash;genhaug&quot;</span>,</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">zIndex: <span style="color: rgb(128, 0, 0);">4</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 102, 0); font-weight: bold;">}</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<h2>A&ntilde;adiendo cajas de informaci&oacute;n</h2>
<p>Para a&ntilde;adir una descripci&oacute;n de tu compa&ntilde;&iacute;a que aparezca cuando un visitante hace clic en el logo podemos agregar un infobox. Con la API Google Maps esto es f&aacute;cilisimo.</p>
<p><img width="500" height="398" class="alignnone size-full wp-image-11109" src="http://www.elwebmaster.com/wp-content/uploads/2009/10/infobox.png" alt="infobox" /></p>
<p>Peguemos este c&oacute;digo luego de definir la variable map:</p>
<div class="igBar"><span id="lphp-11"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> contentString = <span style="color: rgb(255, 0, 0);">&#8216;&lt;div id=&quot;content&quot;&gt;&#8217;</span>+</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&#8216;&lt;div id=&quot;siteNotice&quot;&gt;&#8217;</span>+</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&#8216;&lt;/div&gt;&#8217;</span>+</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&#8216;&lt;h1 id=&quot;firstHeading&quot; class=&quot;firstHeading&quot;&gt;H&oslash;genhaug&lt;/h1&gt;&#8217;</span>+</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&#8216;&lt;div id=&quot;bodyContent&quot;&gt;&#8217;</span>+</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&#8216;&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;&#8217;</span>+</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&#8216;&lt;/div&gt;&#8217;</span>+</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: rgb(255, 0, 0);">&#8216;&lt;/div&gt;&#8217;</span>;</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> infowindow = <span style="color: rgb(0, 0, 0); font-weight: bold;">new</span> google.maps.InfoWindow<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(0, 102, 0); font-weight: bold;">{</span></div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">&nbsp; &nbsp; content: contentString</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 102, 0); font-weight: bold;">}</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Para hacer que las cajas de informaci&oacute;n aparezcan al hacer clic en nuestro logo, simplemente debemos a&ntilde;adir este c&oacute;digo justo antes del &uacute;ltimo } en la funci&oacute;n <code>initialize()</code>:</p>
<div class="igBar"><span id="lphp-12"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">google.maps.event.addListener<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span>companyMarker, <span style="color: rgb(255, 0, 0);">&#8216;click&#8217;</span>, <span style="color: rgb(0, 0, 0); font-weight: bold;">function</span><span style="color: rgb(0, 102, 0); font-weight: bold;">(</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span> <span style="color: rgb(0, 102, 0); font-weight: bold;">{</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">infowindow.open<span style="color: rgb(0, 102, 0); font-weight: bold;">(</span>map,companyMarker<span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 102, 0); font-weight: bold;">}</span><span style="color: rgb(0, 102, 0); font-weight: bold;">)</span>;</div>
</li>
</ol>
</div>
</div>
</div>
<p>Para hacer un poco m&aacute;s bonita la caja de informaci&oacute;n, a&ntilde;adamos algo de estilo en nuestra hoja de estilos:</p>
<div class="igBar"><span id="lcss-13"><a href="http://www.elwebmaster.com/general/insertar-y-personalizar-google-maps-en-tu-sitio-web#" onclick="javascript:showPlainTxt('css-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite">
<div id="css-13">
<div class="css">
<ol>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">body <span style="color: rgb(102, 204, 102);">{</span></div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">font-family</span>: Helvetica, Arial, <span style="color: rgb(153, 51, 51);">sans-serif</span>;</div>
</li>
<li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(0, 0, 0); font-weight: bold;">font-size</span>:10pt;</div>
</li>
<li style="font-weight: bold;">
<div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;"><span style="color: rgb(102, 204, 102);">}</span></div>
</li>
</ol>
</div>
</div>
</div>
<p>Y ah&iacute; lo tienen. Un Google Map bonito y f&aacute;cilmente a&ntilde;adido en tu sitio web o blog.</p>
<h2>Descarga</h2>
<p>Para descargar los archivos de muestra hagan <a href="http://dl.getdropbox.com/u/32709/googlemaps.zip" target="_blank">clic aqu&iacute;</a>.</p>
<p>Fuente: <a href="http://stiern.com/tutorials/adding-custom-google-maps-to-your-website" target="_blank">Stiern</a></p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/11/google-maps-api-personaliza-tu-mapa/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programación de un modulo del kernel simple</title>
		<link>http://smultron.es/2009/10/programacion-de-un-modulo-del-kernel-simple/</link>
		<comments>http://smultron.es/2009/10/programacion-de-un-modulo-del-kernel-simple/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 08:32:18 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4579</guid>
		<description><![CDATA[&#160; Copy&#38;Page: http://systemadmin.es/2009/09/programacion-de-un-modulo-del-kernel-simple Programaci&#243;n de un modulo del kernel simple La programaci&#243;n de un m&#243;dulo del kernel de Linux no es tan diferente de la programaci&#243;n de cualquier otro software, simplemente los errores se suelen pagar m&#225;s caros. Vamos a ver el t&#237;pico Hello World como m&#243;dulo del kernel: Primero de todo deberemos incluir algunos [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Copy&amp;Page: http://systemadmin.es/2009/09/programacion-de-un-modulo-del-kernel-simple</p>
<p><span id="more-4579"></span></p>
<h1>Programaci&oacute;n de un modulo del kernel simple</h1>
<p>La programaci&oacute;n de un m&oacute;dulo del <strong>kernel de Linux</strong> no es tan diferente de la programaci&oacute;n de cualquier otro software, simplemente los errores se suelen pagar m&aacute;s caros. Vamos a ver el t&iacute;pico <strong>Hello World</strong> como <strong>m&oacute;dulo del kernel</strong>:</p>
<p><!-- more --></p>
<p>Primero de todo deberemos incluir algunos <strong>headers</strong> que contienen definiciones que vamos a necesitar:</p>
<pre>
#include &lt;linux/init.h&gt;
#include &lt;linux/module.h&gt;
</pre>
<p>A continuaci&oacute;n deberemos definir la <strong>licencia del modulo</strong>:</p>
<pre>
MODULE_LICENSE(&quot;GPL&quot;);
</pre>
<p>Si nos la inventamos simplemente nos avisara al hacer el <strong>insmod</strong>:</p>
<pre>
helloworld: module license 'xGPL' taints kernel.
</pre>
<p>A continuaci&oacute;n deberemos definir las funciones de inicializaci&oacute;n i destrucci&oacute;n del modulo en las cuales para este sencillo ejemplo haremos un simple <strong>printk</strong> (equivalente de <strong>printf</strong> en el kernel):</p>
<pre>
static int hello_world_init(void)
{
        printk(KERN_ALERT &quot;Hello World!\n&quot;);
        return 0;
}
</pre>
<p>En la funci&oacute;n de destrucci&oacute;n haremos lo mismo:</p>
<pre>
static void hello_world_exit(void)
{
        printk(KERN_ALERT &quot;Bye World!\n&quot;);
}
</pre>
<p>Finalmente deberemos indicar como hemos llamado a las funciones mediante <strong>module_init</strong> y <strong>module exit</strong>:</p>
<pre>
module_init(hello_world_init);
module_exit(hello_world_exit);
</pre>
<p>Finalmente deberemos crear el fichero de <strong>Makefile</strong>:</p>
<pre>
obj-m += helloworld.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
</pre>
<p>Es obligatorio que antes de los comandos &ldquo;<strong>make</strong>&rdquo; haya un tabulador y no un conjunto de espacios, sino no va a reconocer el formato del <strong>Makefile</strong>.</p>
<p>Con el comando <strong>make</strong> vamos a compilar el <strong>modulo del kernel</strong>:</p>
<pre>
# make
make -C /lib/modules/2.6.18-53.1.21.el5PAE/build M=/home/jordi/helloworld modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-53.1.21.el5-PAE-i686'
  CC [M]  /home/jordi/helloworld/helloworld.o
  Building modules, stage 2.
  MODPOST
  CC      /home/jordi/helloworld/helloworld.mod.o
  LD [M]  /home/jordi/helloworld/helloworld.ko
make[1]: Leaving directory `/usr/src/kernels/2.6.18-53.1.21.el5-PAE-i686'
</pre>
<p>Mediante un <strong>ls</strong> podemos ver los ficheros que ha generado:</p>
<pre>
# ls
helloworld.c  helloworld.ko  helloworld.mod.c  helloworld.mod.o  helloworld.o  Makefile  Module.symvers
</pre>
<p>Podemos cargar el m&oacute;dulo mediante <strong>insmod</strong>:</p>
<pre>
insmod helloworld.ko
</pre>
<p>A continuaci&oacute;n mediante el <strong>dmesg</strong> podremos ver el <strong>Hello World</strong>:</p>
<pre>
audit(1254211500.001:3472101): user pid=1772 uid=0 auid=0 msg='insmod helloworld.ko '
Hello World!
</pre>
<p>Una forma de ver que el m&oacute;dulo esta cargado es mediante <strong>lsmod</strong>:</p>
<pre>
# lsmod  | grep hel
helloworld              5504  0
</pre>
<p>Para ver el &ldquo;Bye World&rdquo; lo descargamos mediante <strong>rmmod</strong>:</p>
<pre>
rmmod helloworld
</pre>
<p>Y de nuevo, con <strong>dmesg</strong>, podremos ver el mensaje de despedida:</p>
<pre>
audit(1254211613.892:3472132): user pid=1772 uid=0 auid=0 msg='rmmod helloworld'
Bye World!
audit(1254211627.421:3472133): user pid=1772 uid=0 auid=0 msg='dmesg </pre>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/10/programacion-de-un-modulo-del-kernel-simple/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Seguir una llamada a sistema concreta con strace</title>
		<link>http://smultron.es/2009/10/seguir-una-llamada-a-sistema-concreta-con-strace/</link>
		<comments>http://smultron.es/2009/10/seguir-una-llamada-a-sistema-concreta-con-strace/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 08:24:17 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[copy&page]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sistema]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4577</guid>
		<description><![CDATA[&#160; Copy&#38;Page: http://systemadmin.es/2009/09/seguir-una-llamada-a-sistema-concreta-con-strace Cuando se deben resolver problemas extra&#241;os con el sistema se suele recurrir a strace para ver que esta ocurriendo. El principal inconveniente de strace es que da mucha informaci&#243;n, lo cual puede llegar a despistar m&#225;s que ayudar. Vamos a ver como seguir una llamada concreta al sistema. Mediante el par&#225;metro -e [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Copy&amp;Page: http://systemadmin.es/2009/09/seguir-una-llamada-a-sistema-concreta-con-strace</p>
<p><span id="more-4577"></span></p>
<p>Cuando se deben resolver problemas extra&ntilde;os con el sistema se suele recurrir a <strong>strace</strong> para ver que esta ocurriendo. El principal inconveniente de <strong>strace</strong> es que da mucha informaci&oacute;n, lo cual puede llegar a despistar m&aacute;s que ayudar. Vamos a ver como seguir una llamada concreta al sistema.</p>
<p><!-- more --></p>
<p>Mediante el par&aacute;metro <strong>-e</strong> podemos indicar una expresi&oacute;n que filtre las llamadas que queremos ver. Por ejemplo, si queremos ver solo las llamadas a la funci&oacute;n <strong>open</strong> usar&iacute;amos como par&aacute;metro <strong>trace=open</strong>. El comando completo ser&iacute;a:</p>
<pre>
# strace -s 128 -fF -e trace=open ls
open(&quot;/etc/ld.so.cache&quot;, O_RDONLY)      = 3
open(&quot;/lib64/librt.so.1&quot;, O_RDONLY)     = 3
open(&quot;/lib64/libacl.so.1&quot;, O_RDONLY)    = 3
open(&quot;/lib64/libc.so.6&quot;, O_RDONLY)      = 3
open(&quot;/lib64/libpthread.so.0&quot;, O_RDONLY) = 3
open(&quot;/lib64/libattr.so.1&quot;, O_RDONLY)   = 3
open(&quot;/lib64/libdl.so.2&quot;, O_RDONLY)     = 3
open(&quot;/lib64/libsepol.so.1&quot;, O_RDONLY)  = 3
open(&quot;/proc/mounts&quot;, O_RDONLY)          = 3
open(&quot;/usr/lib/locale/locale-archive&quot;, O_RDONLY) = 3
open(&quot;.&quot;, O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 3
index.php
</pre>
<p>Tambi&eacute;n podemos definir un conjunto de llamadas separadas por comas:</p>
<pre>
# strace -s 128 -fF -e trace=open,close ls
open(&quot;/etc/ld.so.cache&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(&quot;/lib64/librt.so.1&quot;, O_RDONLY)     = 3
close(3)                                = 0
open(&quot;/lib64/libacl.so.1&quot;, O_RDONLY)    = 3
close(3)                                = 0                           = 0
open(&quot;/lib64/libc.so.6&quot;, O_RDONLY)      = 3
close(3)                                = 0
open(&quot;/lib64/libpthread.so.0&quot;, O_RDONLY) = 3
close(3)                                = 0
open(&quot;/lib64/libattr.so.1&quot;, O_RDONLY)   = 3
close(3)                                = 0
open(&quot;/lib64/libdl.so.2&quot;, O_RDONLY)     = 3
close(3)                                = 0
open(&quot;/lib64/libsepol.so.1&quot;, O_RDONLY)  = 3
close(3)                                = 0                            = 0
open(&quot;/proc/mounts&quot;, O_RDONLY)          = 3
close(3)                                = 0
open(&quot;/usr/lib/locale/locale-archive&quot;, O_RDONLY) = 3
close(3)                                = 0
open(&quot;.&quot;, O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 3
close(3)                                = 0
index.php
close(1)                                = 0
</pre>
<p>Podemos incluso definir <strong>filtros inversos</strong>, es decir, ver todas las llamadas al sistema excepto una o un conjunto indicando una admiraci&oacute;n (<strong>!</strong>) para indicar la negaci&oacute;n del <strong>filtro</strong>. Por ejemplo, para ver todas las llamadas excepto <strong>open</strong> y <strong>close</strong> usar&iacute;amos el filtro &ldquo;<strong>trace=!open,close</strong>&ldquo;:</p>
<pre>
# strace -s 128 -fF -e 'trace=!open,close' ls
execve(&quot;/bin/ls&quot;, [&quot;ls&quot;], [/* 25 vars */]) = 0
brk(0)                                  = 0x127c3000
uname({sys=&quot;Linux&quot;, node=&quot;maria.grupointercom.com&quot;, ...}) = 0
access(&quot;/etc/ld.so.preload&quot;, R_OK)      = -1 ENOENT (No such file or directory)
fstat(3, {st_mode=S_IFREG|0644, st_size=39087, ...}) = 0
read(3, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0 \&quot;`&lt;2\0\0\0@\0\0\0\0\0\0\0\10\307\0\0\0\0\0\0\0\0\0\0@\0008\0\t\0@\0'\0&amp;\0\6\0\0\0\5\0\0\0@\0\0\0\0\0\0\0@\0`&lt;2\0\0\0@\0`&lt;2\0\0\0\370\1\0\0\0\0\0\0\370\1\0\0\0\0\0\0\10\0\0\0\0\0\0\0\3\0\0\0\4\0\0\0&quot;..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=53448, ...}) = 0
mprotect(0x323c607000, 2097152, PROT_NONE) = 0
read(3, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&gt;\0\1\0\0\0\0\31 \2234\0\0\0@\0\0\0\0\0\0\0(f\0\0\0\0\0\0\0\0\0\0@\0008\0\5\0@\0\35\0\34\0\1\0\0\0\5\0\0\0\0\0\0\0\0\0\0\0\0\0 \2234\0\0\0\0\0 \2234\0\0\0004Y\0\0\0\0\0\0004Y\0\0\0\0\0\0\0\0 \0\0\0\0\0\1\0\0\0\6\0\0\0&quot;..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=28008, ...}) = 0
(...)
</pre>
<p><!-- Social Bookmarking Reloaded BEGIN --></p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/10/seguir-una-llamada-a-sistema-concreta-con-strace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mas cosas guays sobre el comando &#8220;SED&#8221;</title>
		<link>http://smultron.es/2009/10/mas-cosas-guays-sobre-el-comando-sed/</link>
		<comments>http://smultron.es/2009/10/mas-cosas-guays-sobre-el-comando-sed/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 14:33:35 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[copy&page]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4542</guid>
		<description><![CDATA[Copy&#38;page:http://programacionbizarra.blogspot.com/2009/03/presentacion-del-sed-copyright-c-2009.html Tutorial, Gu&#237;a o Simplemente Introducci&#243;n al Comando Sed de Unix &#160; Copyright (c) 2009 H&#233;ctor Francisco Hern&#225;ndez &#60;hectorfh@gmail.com&#62;. Se otorga permiso para copiar, distribuir y/o modificar este documento bajo los t&#233;rminos de la Licencia de Documentaci&#243;n Libre de GNU, Versi&#243;n 1.3 o cualquier otra versi&#243;n posterior publicada por la Free Software Foundation; sin Secciones [...]]]></description>
			<content:encoded><![CDATA[<p>Copy&amp;page:http://programacionbizarra.blogspot.com/2009/03/presentacion-del-sed-copyright-c-2009.html</p>
<p><span id="more-4542"></span></p>
<p>Tutorial, Gu&iacute;a o Simplemente Introducci&oacute;n al Comando Sed de Unix</p>
<p>&nbsp;</p>
<p>
Copyright (c) 2009 H&eacute;ctor Francisco Hern&aacute;ndez &lt;hectorfh@gmail.com&gt;.</p>
<p>
Se otorga permiso para copiar, distribuir y/o modificar este documento bajo los t&eacute;rminos de la Licencia de Documentaci&oacute;n Libre de GNU, Versi&oacute;n 1.3 o cualquier otra versi&oacute;n posterior publicada por la Free Software Foundation; sin Secciones Invariantes ni Textos de Cubierta Delantera ni Textos de Cubierta Trasera. Una copia de la licencia se encuentra en http://www.gnu.org/copyleft/fdl.html.</p>
<p>&nbsp;</p>
<h2>1. Introducci&oacute;n</h2>
<p>&nbsp;</p>
<p>
La herramienta de Unix &quot;sed&quot; (&quot;stream editor&quot; o &quot;editor de flujo&quot;) es, junto con &quot;awk&quot; (y sin<br />
contar a Perl, la panacea, en la contienda), la m&aacute;s poderosa en lo que<br />
a procesamiento de texto plano se refiere.</p>
<p>&nbsp;</p>
<p>
Al igual que el editor &quot;ed&quot;, del cual toma todos sus comandos, permite escribir peque&ntilde;os scripts de edici&oacute;n de texto en un<br />
particular lenguaje:</p>
<p>&nbsp;</p>
<pre>
# el comando &quot;i&quot; inserta texto en la l&iacute;nea
# que se le indique
sed '7i hola mundo' zaraza.txt

# el comando &quot;d&quot; borra l&iacute;neas
sed '1d' zaraza.txt

# el comando &quot;s&quot; sustituye texto utilizando
# expresiones regulares si se desea
sed '1,$s/palavra/palabra/g' zaraza.txt
</pre>
<p>&nbsp;</p>
<p>
Sin embargo, su caracter&iacute;stica distintiva es la habilidad de procesar<br />
texto proveniente desde la entrada est&aacute;ndar. La que lo convierte en una<br />
herramienta ideal para construir filtros y utilizarlos en nuestros scripts<br />
Bourne, Korn, tcsh, bash, o lo que fuere.</p>
<p>&nbsp;</p>
<h2>2. Uso B&aacute;sico</h2>
<p>&nbsp;</p>
<p>
Las instrucciones que entiende &quot;sed&quot; est&aacute;n compuestas primero por el<br />
n&uacute;mero o rango de l&iacute;neas sobre el cual se realizar&aacute; la transformaci&oacute;n y<br />
luego por la acci&oacute;n a realizar. Omitir el n&uacute;mero o rango de l&iacute;neas<br />
implicar&aacute; que la acci&oacute;n se ejecute sobre la totalidad de las mismas.</p>
<p>&nbsp;</p>
<p>
De este modo si, por ejemplo, disponemos del siguiente listado obtenido por el<br />
comando &quot;ps&quot;:</p>
<p>&nbsp;</p>
<pre>
 PID   TTY TIME     CMD
6245 pts/1 00:00:00 bash
6246 pts/1 00:00:00 ps
</pre>
<p>&nbsp;</p>
<p>
Y para procesar el listado queremos suprimir los t&iacute;tulos,<br />
podr&iacute;amos eliminar la primera l&iacute;nea con la instrucci&oacute;n<br />
&quot;1d&quot;. Por lo tanto nuestro comando en el shell ser&iacute;a<br />
&quot;ps | sed &#8217;1d&#8217;&quot; y obtendr&iacute;amos:</p>
<p>&nbsp;</p>
<pre>
6245 pts/1 00:00:00 bash
6246 pts/1 00:00:00 ps
</pre>
<p>&nbsp;</p>
<p>
Los rangos de l&iacute;neas son de la forma &quot;n,m&quot; que significa<br />
&quot;desde la l&iacute;nea n inclusive hasta la l&iacute;nea m&quot;.<br />
Pudiendo &quot;m&quot; ser el s&iacute;mbolo especial &quot;$&quot; que<br />
indica el final del archivo.</p>
<p>&nbsp;</p>
<p>
As&iacute;, por ejemplo, si quisi&eacute;ramos, como generalmente ocurre,<br />
obtener desde la l&iacute;nea 74 hasta la 83 de un archivo de texto denominado<br />
&quot;xxx&quot; podr&iacute;amos hacerlo con la instrucci&oacute;n<br />
&quot;74,83p&quot; as&iacute;:</p>
<p>&nbsp;</p>
<pre>
sed -n '74,83p' xxx
</pre>
<p>&nbsp;</p>
<p>
En este ejemplo debo hacer notar el par&aacute;metro &quot;-n&quot;. Por<br />
defecto &quot;sed&quot; imprime todo a la salida est&aacute;ndar, s&oacute;lo<br />
que &quot;-n&quot; modifica este comportamiento para que no lo haga. Por lo<br />
tanto, si no us&aacute;ramos el par&aacute;metro &quot;-n&quot;<br />
obtendr&iacute;amos todo el archivo &quot;xxx&quot; con las<br />
l&iacute;neas desde la 74 hasta la 83 duplicadas, ya que la instrucci&oacute;n<br />
&quot;p&quot; volver&iacute;a a imprimirlas.</p>
<p>&nbsp;</p>
<p>
No s&oacute;lo es posible indicar un n&uacute;mero de l&iacute;nea o un rango num&eacute;rico,<br />
tambi&eacute;n es posible indicar una expresi&oacute;n regular o un rango de<br />
expresiones regulares.</p>
<p>&nbsp;</p>
<p>
Cuando queremos que la acci&oacute;n se ejecute sobre las l&iacute;neas que<br />
coincidan con una expresi&oacute;n determinada, debemos escribirla delante del<br />
comando entre barras:</p>
<p>&nbsp;</p>
<pre>
# imprime s&oacute;lo las l&iacute;neas que tengan la
# palabra &quot;proc&quot;, lo mismo que har&iacute;a el
# comando &quot;grep proc&quot;
sed -n '/proc/p'

# borra lo que se encuentre entre
# &quot;#ifdef __WIN32__&quot; y &quot;#endif&quot;
sed '/#ifdef __WIN32__/,/#endif/d'
</pre>
<p>&nbsp;</p>
<p>
De este modo, por ejemplo, si disponemos del siguiente listado arrojado por<br />
&quot;ls&quot;:</p>
<p>&nbsp;</p>
<pre>
total 888
-rw-r--r--  1 usuario1 users   2737 2003-04-01 04:36 LICENSE.txt
-rw-r--r--  1 usuario1 users   3639 2003-04-01 04:36 README.txt
drwxr-xr-x  4 usuario1 users   4096 2007-09-08 21:52 build
drwxr-xr-x  2 usuario1 users   4096 2007-09-08 21:52 convert
drwxr-xr-x  5 usuario1 users   4096 2007-09-08 21:52 docs
drwxr-xr-x 12 usuario1 users   4096 2007-09-08 21:52 examples
drwxr-xr-x  3 usuario1 users   4096 2003-04-01 04:35 src
drwxr-xr-x 12 usuario1 users   4096 2003-04-01 04:36 test
-rw-r--r--  1 usuario1 users 351405 2003-04-01 04:36 velocity-1.3.1.jar
-rw-r--r--  1 usuario1 users 510105 2003-04-01 04:36 velocity-dep-1.3.1.jar
drwxr-xr-x  5 usuario1 users   4096 2007-09-08 21:52 xdocs
</pre>
<p>&nbsp;</p>
<p>
Y queremos obtener un listado s&oacute;lo de los directorios (las filas que<br />
comienzan con la letra &quot;d&quot;). Podr&iacute;amos utilizar el sed para<br />
borrar las entradas que no comienzan con esa letra:<br />
&quot;ls -l | sed &#8216;/^d/!d&#8217;&quot;:</p>
<p>&nbsp;</p>
<pre>
drwxr-xr-x  4 usuario1 users 4096 2007-09-08 21:52 build
drwxr-xr-x  2 usuario1 users 4096 2007-09-08 21:52 convert
drwxr-xr-x  5 usuario1 users 4096 2007-09-08 21:52 docs
drwxr-xr-x 12 usuario1 users 4096 2007-09-08 21:52 examples
drwxr-xr-x  3 usuario1 users 4096 2003-04-01 04:35 src
drwxr-xr-x 12 usuario1 users 4096 2003-04-01 04:36 test
drwxr-xr-x  5 usuario1 users 4096 2007-09-08 21:52 xdocs
</pre>
<p>&nbsp;</p>
<p>
Note que el s&iacute;mbolo de exclamaci&oacute;n &quot;!&quot; detr&aacute;s<br />
de la expresi&oacute;n regular niega la condici&oacute;n. Esto deber&iacute;a<br />
leerse como &quot;borre todas las l&iacute;neas que no comiencen con la letra<br />
d&quot;.</p>
<p>&nbsp;</p>
<p>
Otra forma de obtener el mismo resultado es imprimiendo s&oacute;lo<br />
las l&iacute;neas que comienzan con la letra &quot;d&quot;:</p>
<p>&nbsp;</p>
<pre>
ls -l | sed -n '/^d/p'
</pre>
<p>&nbsp;</p>
<p>
Explicar las expresiones regulares va m&aacute;s all&aacute; de los<br />
l&iacute;mites de este art&iacute;culo, pero el car&aacute;cter &quot;^&quot;<br />
significa &quot;comienzo de l&iacute;nea&quot;, por lo tanto &quot;^d&quot;<br />
hace referencia a las l&iacute;neas que poseen una &quot;d&quot; seguida de<br />
su comienzo.</p>
<p>&nbsp;</p>
<h2>3. Lo M&aacute;s Importante: El Comando &quot;s&quot;</h2>
<p>&nbsp;</p>
<p>
El comando &quot;s&quot; sustituye expresiones regulares en la l&iacute;nea actual.<br />
Este comando por s&iacute; s&oacute;lo ser&iacute;a justificaci&oacute;n para<br />
la existencia del sed.</p>
<p>&nbsp;</p>
<p>
El modo de uso de este comando es &quot;s/patr&oacute;n/reemplazo/flags&quot;. Donde<br />
&quot;patr&oacute;n&quot; es la expresi&oacute;n regular que debe sustituirse por<br />
&quot;reemplazo&quot; y los flags son modificadores opcionales que indican, por ejemplo,<br />
si la b&uacute;squeda debe discriminar entre may&uacute;sculas y<br />
min&uacute;sculas o no.</p>
<p>&nbsp;</p>
<p>
Siguiendo mi uso de explicar con ejemplos, suponga que posee un texto donde<br />
las palabras podr&iacute;an estar separadas por m&aacute;s de un espacio:</p>
<p>&nbsp;</p>
<pre>
Aqu&iacute;   me pongo a   cantar
al  comp&aacute;s de    la vig&uuml;ela,
que al hombre  que lo desvela
una   pena     estrordinaria,
como la ave solitaria
con    el cantar se   consuela.
</pre>
<p>&nbsp;</p>
<p>
Sin embargo usted necesita, por alguna extra&ntilde;a raz&oacute;n que ahora no<br />
se me ocurre, que est&eacute;n separadas por exactamente un &uacute;nico<br />
espacio. Podr&iacute;a sustituir el patr&oacute;n &quot;uno o m&aacute;s espacios&quot;<br />
por un &uacute;nico espacio. El comando ser&iacute;a:</p>
<p>&nbsp;</p>
<pre>
sed 's/ \+/ /g'
</pre>
<p>&nbsp;</p>
<p>
El &quot;\+&quot; luego de un car&aacute;cter significa una o m&aacute;s ocurrencias de<br />
ese car&aacute;cter (se recomienda leer sobre expresiones regulares en general).<br />
La letra &quot;g&quot; al final es un flag que hace que se sustituyan todos los patrones<br />
encontrados en cada l&iacute;nea. Sin &eacute;l s&oacute;lo se<br />
sustituir&aacute; la primera ocurrencia en cada rengl&oacute;n del texto.</p>
<p>&nbsp;</p>
<p>
El resultado:</p>
<p>&nbsp;</p>
<pre>
Aqu&iacute; me pongo a cantar
al comp&aacute;s de la vig&uuml;ela,
que al hombre que lo desvela
una pena estrordinaria,
como la ave solitaria
con el cantar se consuela.
</pre>
<p>&nbsp;</p>
<p>
Y as&iacute; tambi&eacute;n es posible hacer referencia al &quot;patr&oacute;n&quot; o a<br />
&quot;subpatrones&quot; en el &quot;reemplazo&quot; mediante los car&aacute;cteres especiales<br />
&quot;\&amp;&quot; y &quot;\1&quot;, &quot;\2&quot;, &quot;\3&quot;&#8230; &quot;\n&quot; respectivamente. Por ejemplo, suponga que<br />
posee la siguiente lista en la que cada elemento es de la forma<br />
&quot;archivo@direcorio&quot;:</p>
<p>&nbsp;</p>
<pre>
libhardware.a@dosbox-0.70/src/hardware
Makefile.in@dosbox-0.70/src/libs
video.h@dosbox-0.70/include
README.video@dosbox-0.70/docs
Makefile@dosbox-0.70/visualc_net
</pre>
<p>&nbsp;</p>
<p>
Luego de aplicarle a la lista &quot;sed &#8216;s_\(.*\)@\(.*\)_\2/\1_&#8217;&quot;, obtenemos:</p>
<p>&nbsp;</p>
<pre>
dosbox-0.70/src/hardware/libhardware.a
dosbox-0.70/src/libs/Makefile.in
dosbox-0.70/include/video.h
dosbox-0.70/docs/README.video
dosbox-0.70/visualc_net/Makefile
</pre>
<p>&nbsp;</p>
<p>
Esto significa que &quot;\1&quot; hace referencia al subpatr&oacute;n que se encuentra<br />
entre los primeros par&eacute;ntesis y que &quot;\2&quot; hace referencia al<br />
subpatr&oacute;n entre los segundos par&eacute;ntesis. F&iacute;jese<br />
tambi&eacute;n que en lugar de separar los par&aacute;metros del comando con<br />
una barra &quot;/&quot; lo hice con &quot;_&quot;. Esto es porque sed nos permite utilizar cualquier<br />
car&aacute;cter como separador y se dar&aacute; cuenta autom&aacute;ticamente<br />
de cu&aacute;l estamos usando.</p>
<p>&nbsp;</p>
<p>
Aunque el ejemplo que acabo de ense&ntilde;ar parece est&uacute;pido,<br />
cr&eacute;ame que es real y que para un trabajo me ha tocado hacer un script<br />
que le&iacute;a una lista con esa estructura.</p>
<p>&nbsp;</p>
<h2>4. Procesando Varias L&iacute;neas por Vez</h2>
<p>&nbsp;</p>
<p>
Hasta el momento en todos los ejemplos que mostr&eacute; se le&iacute;a una<br />
l&iacute;nea, se chequeaba una condici&oacute;n y se realizaba una<br />
operaci&oacute;n. Y as&iacute; cada operaci&oacute;n involucraba una<br />
&uacute;nica l&iacute;nea.</p>
<p>&nbsp;</p>
<p>
Existen, sin embargo, circunstancias en las que es necesario operar sobre<br />
m&aacute;s de una l&iacute;nea por vez. Observe el siguiente archivo:</p>
<p>&nbsp;</p>
<pre>
Registro: 1
Nombre: Anibal
Telefono: 621-229

Registro: 2
Nombre: Hector
Telefono: 562-245

Registro: 3
Nombre: Pablo
Telefono: 622-354
</pre>
<p>&nbsp;</p>
<p>
Alguien ha decidido guardar una lista de personas con sus n&uacute;meros<br />
de tel&eacute;fonos en un extra&ntilde;o formato, utilizando cuatro<br />
l&iacute;neas por registro.<br />
Nuestra tarea es poner la informaci&oacute;n en una manera m&aacute;s<br />
conveniente para su procesamiento:</p>
<p>&nbsp;</p>
<pre>
1;Anibal;621-229
2;Hector;562-245
3;Pablo;622-354
</pre>
<p>&nbsp;</p>
<p>
Claro est&aacute; que ser&iacute;a imposible<br />
solucionar este problema leyendo de a una l&iacute;nea a la vez. Ser&iacute;a<br />
bueno poder trabajar leyendo de a un registro (cuatro l&iacute;neas) por<br />
iteraci&oacute;n.</p>
<p>&nbsp;</p>
<p>
Este tipo de problemas se resuelve con el comando &quot;N&quot;, que fuerza<br />
la lectura<br />
de la siguiente l&iacute;nea en la iteraci&oacute;n actual.</p>
<p>&nbsp;</p>
<p>
Al comenzar la iteraci&oacute;n, sed trae la l&iacute;nea al buffer.<br />
Internamente el valor del buffer ser&iacute;a:</p>
<p>&nbsp;</p>
<pre>
buffer = &quot;Registro: 1&quot;
</pre>
<p>&nbsp;</p>
<p>
Luego de ejecutar la instrucci&oacute;n &quot;N&quot;, que lee la<br />
l&iacute;nea siguiente y la concatena en el buffer, quedar&iacute;a:</p>
<p>&nbsp;</p>
<pre>
buffer = &quot;Registro: 1\nNombre: Anibal&quot;
</pre>
<p>&nbsp;</p>
<p>
Observe que &quot;\n&quot; significa &quot;nueva l&iacute;nea&quot;<br />
(el car&aacute;cter ASCII n&uacute;mero 10).</p>
<p>&nbsp;</p>
<p>
Como vemos, nos vamos aproximando a la soluci&oacute;n. Basta con leer<br />
dos l&iacute;neas m&aacute;s y ya tenemos el registro completo.<br />
Y luego de hacerlo debemos reemplazar el retorno de carro &quot;\n&quot;<br />
por &quot;;&quot; con &quot;s/\n/;/g&quot;, para as&iacute; llegar a:</p>
<p>&nbsp;</p>
<pre>
buffer = &quot;Registro: 1;Nombre: Anibal;Telefono: 621-229;&quot;
</pre>
<p>&nbsp;</p>
<p>
Ahora resta quitar lo que molesta, las palabras<br />
&quot;Registro: &quot;, &quot;Nombre: &quot;, &quot;Telefono: &quot; y el<br />
punto y coma de m&aacute;s al final.</p>
<p>&nbsp;</p>
<p>
Para lograrlo utilizaremos una super sustituci&oacute;n con expresiones<br />
regulares:</p>
<p>&nbsp;</p>
<pre>
&quot;s/^Registro: \(.*\);Nombre: \(.*\);Telefono: \(.*\);$/\1;\2;\3/&quot;
</pre>
<p>&nbsp;</p>
<pre>
buffer = &quot;1;Anibal;621-229&quot;
</pre>
<p>&nbsp;</p>
<p>
Ahora podr&iacute;amos poner todo junto.<br />
Suponiendo que los datos originales estaban en el archivo &quot;agenda&quot;,<br />
nuestro comando quedar&iacute;a:</p>
<p>&nbsp;</p>
<pre>
sed 'N;N;N;s/\n/;/g;s/^Registro: \(.*\);Nombre: \(.*\);Telefono: \(.*\);$/\1;\2;\3/' agenda
</pre>
<p>&nbsp;</p>
<p>
Ilegible, &iquest;verdad? Si as&iacute; lo considera, puede hacerlo en dos<br />
pasos invocando dos veces al sed.</p>
<p>&nbsp;</p>
<h2>5. Programaci&oacute;n en Sed</h2>
<p>&nbsp;</p>
<p>
En la documentaci&oacute;n del sed de GNU, el cap&iacute;tulo que explica esto dice<br />
&quot;Comandos para gur&uacute;es del sed &#8230; En la mayor&iacute;a de los casos, el uso de<br />
estos comandos indican que probablemente sea mejor programar en awk o Perl&quot;.<br />
La raz&oacute;n por la cual ense&ntilde;o estos comandos es para mostrar el l&iacute;mite de la herramienta.</p>
<p>&nbsp;</p>
<p>
A pesar de no tener variables ni poseer forma de controlar el flujo de<br />
ejecuci&oacute;n m&aacute;s que con etiquetas, un comando para &quot;GOTO&quot; y otro<br />
para &quot;GOTO&quot; condicional, sed es un lenguaje &quot;Turing-completo&quot;. Esto es que<br />
tiene un poder computacional equivalente a la m&aacute;quina universal de<br />
Turing. Por eso circula un mito nerd de que en alg&uacute;n lugar de la web<br />
se puede descargar los fuentes de un sokoban, un arkanoid y alg&uacute;n otro<br />
juego cl&aacute;sico implementado en sed.</p>
<p>&nbsp;</p>
<p>
Los comandos para hacer un &quot;GOTO&quot; incondicional y condicional son &quot;b&quot; y &quot;t&quot;<br />
respectivamente. Las etiquetas se definen con el comando &quot;:&quot;. Adem&aacute;s<br />
sed posee un buffer denominado &quot;hold space&quot; que provee un espacio adicional para<br />
almacenar datos sobre el cual podremos guardar y recuperar lo que pongamos con<br />
los comandos h, H, g, G, x. Refi&eacute;ranse a la documentaci&oacute;n del sed<br />
los interesados, pues no tengo inter&eacute;s en explicar sobre este asunto.</p>
<p>&nbsp;</p>
<p>
Imaginese que sin variables, sin estructuras de control y sin operadores<br />
aritm&eacute;ticos entre otras cosas,<br />
la programaci&oacute;n en sed no es m&aacute;s que otro aburrido juego de<br />
ingenio para simios. Por este motivo ser&aacute; que finalizar&eacute; este<br />
cap&iacute;tulo copi&aacute;ndole un script del tutorial &quot;Sed &#8211; An Introduction and<br />
Tutorial&quot; de Bruce Barnett que ilustra algo de esto y dejar&eacute; el tema<br />
all&iacute; mismo.</p>
<p>&nbsp;</p>
<p>
Lo que hace el ejemplo es guardar los p&aacute;rrafos en el &quot;hold buffer&quot; a<br />
medida que los va leyendo. Si el p&aacute;rrafo posee el patr&oacute;n pasado<br />
por par&aacute;metro al script lo imprime.</p>
<p>&nbsp;</p>
<pre>
#!/bin/sh
sed -n '
# Si es una l&iacute;nea vac&iacute;a, finaliza el p&aacute;rrafo.
# Por lo tanto se debe analizar. Se hace un &quot;GOTO&quot; a &quot;para&quot;.
/^$/ b para
# Si la l&iacute;nea no est&aacute; vac&iacute;a, se agrega al &quot;hold buffer&quot;.
H
# Al final del archivo se analiza el &uacute;ltimo p&aacute;rrafo.
# &quot;GOTO&quot; a &quot;para&quot;.
$ b para
# Se hace un &quot;GOTO&quot; al final del script.
b
# La etiqueta &quot;para&quot;. Secci&oacute;n donde se analiza el p&aacute;rrafo.
:para
# Se recupera el p&aacute;rrafo completo.
x
# Se busca el patr&oacute;n, si se encuetra se imprime el p&aacute;rrafo.
/'$1'/ p
'
</pre>
<p>&nbsp;</p>
<h2>6. Ap&eacute;ndice A: Quitando Tags XML. El Criterio &quot;The Longest Match&quot;</h2>
<p>&nbsp;</p>
<p>
Para mostrar c&oacute;mo se hace har&eacute; el siguiente ejercicio. Suponga<br />
el siguiente c&oacute;digo HTML:</p>
<p>&nbsp;</p>
<pre>
&lt;h2&gt;Contenido&lt;/h2&gt;
&lt;ul&gt;
&lt;li class=&quot;toclevel-1&quot;&gt;1 &lt;span class=&quot;toctext&quot;&gt;Historia&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1&quot;&gt;2 &lt;span class=&quot;toctext&quot;&gt;Ventajas del XML&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;toclevel-1&quot;&gt;3 &lt;span class=&quot;toctext&quot;&gt;Estructura del XML&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<p>&nbsp;</p>
<p>
Para obtener el texto sin los tags podr&iacute;a acceder a la p&aacute;gina<br />
ya procesada por el navegador web, copiar el texto con Ctrl-c y pegarlo con<br />
Ctrl-v en mi editor favorito (las teclas pueden cambiar seg&uacute;n el entorno<br />
en el que estemos trabajando). Pero aqu&iacute;, como mi intenci&oacute;n es<br />
mostrar el sed, lo har&eacute; con esta herramienta.</p>
<p>&nbsp;</p>
<p>
Lo que se me ocurre es sustituir el patr&oacute;n &quot;&lt;.*&gt;&quot;<br />
por una cadena vac&iacute;a. Sin embargo el resultado obtendido luego de<br />
ejecutar &quot;sed &#8216;s/&lt;.*&gt;//g&#8217; temp&quot; es varias l&iacute;neas<br />
vac&iacute;as.</p>
<p>&nbsp;</p>
<p>
Lo que pasa es que el patr&oacute;n es ambiguo. Por ejemplo para<br />
&quot;&lt;h2&gt;Contenido&lt;/h2&gt;&quot; sed comenzar&iacute;a leyendo desde<br />
el primer &quot;&lt;&quot;, pero podr&iacute;a detenerse en el &quot;&gt;&quot;<br />
detr&aacute;s del primer h2 o en el &quot;&gt;&quot; detr&aacute;s del segundo<br />
h2. Y los creadores de la herramienta han decidido que se tome siempre la<br />
coincidencia m&aacute;s larga, &quot;the longest match&quot;.</p>
<p>&nbsp;</p>
<p>
Una soluci&oacute;n al problema ser&iacute;a, por ejemplo, utilizar el<br />
patr&oacute;n &quot;&lt;[^&lt;]*&gt;&quot;. &quot;[^&lt;]&quot; significa<br />
cualquier caracter que no sea &quot;&lt;&quot;. En ese caso el resultado<br />
ser&iacute;a:</p>
<p>&nbsp;</p>
<pre>
Contenido
1 Historia
2 Ventajas del XML
3 Estructura del XML
</pre>
<p>&nbsp;</p>
<h2>7. Ap&eacute;ndice B: El Editor &quot;ed&quot;</h2>
<p>&nbsp;</p>
<p>
Los comandos del sed provienen del editor m&aacute;s primitivo de Unix, llamado<br />
&quot;ed&quot;. Este editor, a diferencia de sed que es un editor de flujo, es<br />
un editor com&uacute;n y corriente&#8230; bueno, casi. A diferencia de los editores<br />
modernos no es &quot;WYSIWYG&quot; (What You See Is What You Get, o &quot;lo que<br />
v&eacute;s es lo que obten&eacute;s&quot;), o sea que no nos muestra el texto<br />
que estamos editando, simplemente nos permite escribir comandos (m&aacute;s o<br />
menos los mismos que el sed) de manera interactiva.</p>
<p>&nbsp;</p>
<p>
El uso de este editor no es com&uacute;n en estos tiempos, ya que la<br />
mayor&iacute;a de los programadores y administradores de Unix prefieren trabajar<br />
con el &quot;vi&quot;. Sin embargo, el ed puede aprovecharse como otro comando<br />
para nuestros scripts cuando necesitamos abrir un archivo, hacer una<br />
edici&oacute;n y volver a grabarlo. En ese caso no precisamos un editor de<br />
flujo como el sed, sino m&aacute;s bien alguno que edite el archivo en el lugar.</p>
<p>&nbsp;</p>
<p>
Volvamos al ejemplo de eliminar los espacios sobrantes.</p>
<p>
</p>
<pre>
Aqu&iacute;   me pongo a   cantar
al  comp&aacute;s de    la vig&uuml;ela,
que al hombre  que lo desvela
una   pena     estrordinaria,
como la ave solitaria
con    el cantar se   consuela.
</pre>
<p>&nbsp;</p>
<p>
Imag&iacute;nese que el texto se encuentra en el archivo &quot;prueba.txt&quot;.<br />
Si lo resolvi&eacute;semos con el sed, como hicimos en el ejemplo pasado,<br />
obtendr&iacute;amos el resultado en la salida est&aacute;ndar o en otro archivo. Sin<br />
embargo queremos que los datos permanezcan en &quot;prueba.txt&quot; luego de la<br />
transformaci&oacute;n. Por lo que tenemos dos opciones: a) obtener los datos<br />
en un archivo auxiliar y luego reemplazar &quot;prueba.txt&quot; por este<br />
archivo; o b) editar el archivo en el lugar utilizando el &quot;ed&quot;.</p>
<p>&nbsp;</p>
<p>
El comando para editar el archivo en &quot;ed&quot; es el mismo que en el<br />
&quot;sed&quot; pero con tres salvedades. La primera es que &quot;ed&quot; no<br />
tiene como rango impl&iacute;cito todas las l&iacute;neas del archivo, por lo<br />
que s&iacute; o s&iacute; tenemos que indicarle el rango<br />
&quot;1,$&quot; delante del comando. La segunda es que luego de la<br />
transformaci&oacute;n debemos ejecutar el comando &quot;w&quot; para grabar<br />
el archivo, ya que &quot;ed&quot; no lo har&aacute; autom&aacute;ticamente.<br />
Y la tercera es que los comandos se separan con una nueva l&iacute;nea, y no<br />
con un &quot;;&quot;.</p>
<p>&nbsp;</p>
<p>
&quot;ed&quot; recibe el nombre del archivo como par&aacute;metro y lee los<br />
comandos desde la entrada est&aacute;ndar. Tambi&eacute;n requiere la<br />
opci&oacute;n &quot;-n&quot; para suprimir molestos mensajes. Por lo que<br />
quedar&iacute;a de la siguiente manera:</p>
<p>&nbsp;</p>
<pre>
ed -s prueba.txt &lt;&lt;&lt; $'1,$s/ \+/ /g\nw'
</pre>
<p>&nbsp;</p>
<p>
Pero algunas implementaciones modernas del &quot;sed&quot;, como por ejemplo la<br />
de GNU, tambi&eacute;n poseen la opci&oacute;n &quot;-i&quot; que permite<br />
modificar el archivo en el lugar y obtener el mismo resultado:</p>
<p>&nbsp;</p>
<pre>
sed -i 's/ \+/ /g' prueba.txt
</pre>
<p>&nbsp;</p>
<h2>8. Final</h2>
<p>&nbsp;</p>
<p>
&quot;sed&quot; se encuentra siempre entre mi reducido y selecto repertorio de<br />
herramientas de trabajo. Podr&iacute;a decir que est&aacute; entre las muy<br />
primeras opciones a la hora de realizar cualquier tipo de transformaci&oacute;n<br />
sobre textos extensos y que no conozco otra cosa que lo haga mejor.</p>
<p>&nbsp;</p>
<p>
Adem&aacute;s de eso he tenido la oportunidad de operar en varios sistemas<br />
tipo Unix distintos y todos poseen la herramienta. Y cuando me encontr&eacute;<br />
trabajando con sistemas de otro tipo, a falta de alguna mejor opci&oacute;n, he<br />
tenido la necesidad de instalarla. Dicho sea de paso, he conseguido<br />
implementaciones libres en la internet que se instalan f&aacute;cilmente y sin<br />
ning&uacute;n tipo de problema.</p>
<p>&nbsp;</p>
<p>
La herramienta es m&aacute;s bien compacta, sencilla y poderosa. Por lo que se<br />
logra dominar luego de usarla un par de veces, siempre y cuando se est&eacute;<br />
familiarizado con las expresiones regulares. Y si no lo est&aacute; es muy<br />
recomendable que lea alg&uacute;n tutorial peque&ntilde;o sobre el asunto y lo<br />
ponga en pr&aacute;ctica.</p>
<p>&nbsp;</p>
<p>
Hasta aqu&iacute; espero que haya obtenido una idea acerca del &quot;sed&quot; y<br />
del provecho que le puede sacar tanto para crear scripts o para transformar<br />
todo tipo de textos.</p>
<p>
</p>
<p>Para m&aacute;s informaci&oacute;n sugiero que lea la documentaci&oacute;n de</p>
<p>&nbsp;</p>
<p>la implementaci&oacute;n en su sistema operativo. Si tiene GNU instalado</p>
<p>&nbsp;</p>
<p>escriba &quot;info sed&quot;. Tambi&eacute;n encontrar&aacute; muchos textos</p>
<p>&nbsp;</p>
<p>escritos en todos los idiomas en la internet, lo que es un punto a favor</p>
<p>&nbsp;</p>
<p>del uso del &quot;sed&quot;.</p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/10/mas-cosas-guays-sobre-el-comando-sed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Aplicaciones IPHONE</title>
		<link>http://smultron.es/2009/09/aplicaciones-iphone/</link>
		<comments>http://smultron.es/2009/09/aplicaciones-iphone/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 20:31:43 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[crear]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4519</guid>
		<description><![CDATA[En este documento encontrareis la metodolog&#237;a y experiencia adecuada para desarrollar vuestras propias aplicaciones de iphone. &#160;&#160; Ampliar ENLACE: http://bitelia.com/2009/02/como-crear-una-aplicacion-para-iphone-en-30-dias Enlace Oficial: http://developer.apple.com/iphone/designingcontent.html]]></description>
			<content:encoded><![CDATA[<p>En este documento encontrareis la metodolog&iacute;a y experiencia adecuada para desarrollar vuestras propias aplicaciones de iphone.</p>
<p>&nbsp;<object width="100%" height="500" align="middle" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_483342261362758" name="doc_483342261362758" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param name="movie" value="http://d.scribd.com/ScribdViewer.swf?document_id=12684298&amp;access_key=key-c0uc3wjw8uao8poe0k4&amp;page=1&amp;version=1&amp;viewMode=" /><param name="quality" value="high" /><param name="play" value="true" /><param name="loop" value="true" /><param name="scale" value="showall" /><param name="wmode" value="opaque" /><param name="devicefont" value="false" /><param name="bgcolor" value="#ffffff" /><param name="menu" value="true" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="salign" value="" /><embed width="100%" height="500" align="middle" src="http://d.scribd.com/ScribdViewer.swf?document_id=12684298&amp;access_key=key-c0uc3wjw8uao8poe0k4&amp;page=1&amp;version=1&amp;viewMode=" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_483342261362758_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash"></embed></object>&nbsp;</p>
<p><a alt="PDF" rel="PDF[Manual Smultron]" author="Crea Tu Aplicaci&oacute;n" title="Manual IPHONE" class="lightwindow" href="http://d.scribd.com/ScribdViewer.swf?document_id=12684298&amp;access_key=key-c0uc3wjw8uao8poe0k4&amp;page=1&amp;version=1&amp;viewMode=">Ampliar</a></p>
<p>ENLACE: http://bitelia.com/2009/02/como-crear-una-aplicacion-para-iphone-en-30-dias</p>
<p>Enlace Oficial: http://developer.apple.com/iphone/designingcontent.html</p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/09/aplicaciones-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Claves por defecto</title>
		<link>http://smultron.es/2009/09/claves-por-defecto/</link>
		<comments>http://smultron.es/2009/09/claves-por-defecto/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 20:50:00 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4485</guid>
		<description><![CDATA[Copy&#38;Page:http://www.phenoelit-us.org/dpl/dpl.html Default Password List Last updated: 09.15.2009 Vendor Model Version Access Type Username Password Privileges Notes 3COM CoreBuilder 7000/6000/3500/2500 Telnet debug synnet &#160; &#160; 3COM CoreBuilder 7000/6000/3500/2500 Telnet tech tech &#160; &#160; 3COM HiPerARC v4.1.x Telnet adm (none) &#160; &#160; 3COM LANplex 2500 Telnet debug synnet &#160; &#160; 3COM LANplex 2500 Telnet tech tech &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Copy&amp;Page:<span class="Apple-style-span" style="background-color: rgb(255, 255, 255); "><a href="http://www.phenoelit-us.org/dpl/dpl.html">http://www.phenoelit-us.org/dpl/dpl.html</a></span></p>
<p><span id="more-4485"></span></p>
<p><span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; "></p>
<div style="background-color: rgb(0, 0, 0); color: rgb(255, 153, 0); ">
<h1 align="center">Default Password List</h1>
<h2 align="center">Last updated: 09.15.2009</h2>
<p></p>
<table id="result" style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: solid; border-right-style: none; border-bottom-style: solid; border-left-style: none; border-width: initial; border-color: initial; border-top-width: thin; border-top-color: rgb(34, 34, 34); border-bottom-width: thin; border-bottom-color: rgb(34, 34, 34); ">
<tbody>
<tr>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Vendor</b></td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Model</b></td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Version</b></td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Access Type</b></td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Username</b></td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Password</b></td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Privileges</b></td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; "><b style="font-size: 12px; line-height: 14px; font-family: Helvetica, Arial; color: rgb(255, 153, 0); border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Notes</b></td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CoreBuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000/6000/3500/2500</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">debug</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">synnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CoreBuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000/6000/3500/2500</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">HiPerARC</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">v4.1.x</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">adm</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">LANplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">2500</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">debug</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">synnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">LANplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">2500</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">LinkSwitch</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">2000/2700</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">NetBuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SNMP</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">ANYCOM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">snmp-read</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">NetBuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SNMP</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">ILMI</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">snmp-read</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Netbuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Office Connect ISDN Routers</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">5&#215;0</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">n/a</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">PASSWORD</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SuperStack II Switch</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">2200</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">debug</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">synnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SuperStack II Switch</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">2700</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">OfficeConnect 812 ADSL</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">adminttd</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">adminttd</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Wireless AP</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">ANY</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">comcomcom</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Works on all 3com wireless APs</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CellPlex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">User</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">cellplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">cellplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">operator</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">HiPerARC</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">v4.1.x</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">adm</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3Com SuperStack 3 Switch 3300XM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">security</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">security</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">superstack II</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">1100/3300</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Console</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3comcso</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">RIP000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">initialize</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">resets all pws to defaults</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">LANplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">2500</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CellPlex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">HTTP</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">synnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">NetBuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SNMP</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">User</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SNMP_READ</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SuperStack II Switch</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">2700</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CellPlex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">root</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">HiPerACT</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">v4.1.x</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CellPlex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CellPlex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CellPlex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">tech</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">super</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">cellplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">RS-232/telnet</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SuperStack 3</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">4XXX</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SuperStack 3</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">4XXX</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">monitor</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">monitor</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">User</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SuperStack 3</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">4400-49XX</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">manager</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">manager</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">User can access/change operational setting but not security settings</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">CellPlex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">root</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Netbuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">cellplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">7000</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">operator</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">OfficeConnect 812 ADSL</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">01.50-01</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">cellplex</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">HiPerACT</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">v4.1.x</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3c16405</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">n/a</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3c16405</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Console</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Administrator</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Switch</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3300XM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">SS III Switch</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">4xxx (4900 &#8211; sure)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Telnet</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">recovery</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">recovery</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">resets_all_to_default</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">u need to power off unit. tbl_</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">OfficeConnect Wireless 11g Cable/DSL Gateway</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">HTTP</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
</tr>
<tr style="background-color: rgb(0, 0, 0); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3COM</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Netbuilder</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">HTTP</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Root</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">http://10.1.0.1</td>
</tr>
<tr style="background-color: rgb(34, 34, 34); ">
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3com</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">3C16405</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">&nbsp;</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">Multi</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">admin</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; ">(none)</td>
<td style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-wi</p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/09/claves-por-defecto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Expresiones regulares para VIM</title>
		<link>http://smultron.es/2009/09/expresiones-regulares-para-vim/</link>
		<comments>http://smultron.es/2009/09/expresiones-regulares-para-vim/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 16:49:22 +0000</pubDate>
		<dc:creator>NEO</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://smultron.es/?p=4483</guid>
		<description><![CDATA[&#160; Copy&#38;Page:http://www.geocities.com/volontir/ &#160; &#169; WebRing Inc. The Vi IMproved Editor Web Ring &#60;&#60; Prev &#124; Ring Hub &#124; Join &#124; Rate&#124; Next &#62;&#62; &#160; &#60;center&#62; &#60;table width=&#34;75%&#34; cellpadding=2 cellspacing=0&#62; &#60;tr valign=bottom&#62;&#60;td&#62; &#60;table bgcolor=990066 border=0 width=&#34;75%&#34;&#62;&#60;tr&#62;&#60;td&#62; &#60;table bgcolor=eeeeee cellpadding=6 cellspacing=0 border=0 width=&#34;100%&#34;&#62;&#60;tr&#62;&#60;td align=center&#62; &#60;font face=arial size=-1&#62;This site is a member of WebRing. To browse visit&#60;/font&#62;&#60;br&#62;&#60;font face=arial [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>Copy&amp;Page:http://www.geocities.com/volontir/</p>
<p><span id="more-4483"></span></p>
<table border="0" width="636">
<tbody>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
            <script src="http://ss.webring.com/navbar?f=j&amp;y=oleg66&amp;u=10002161" language="javascript" type="text/javascript">
</script></p>
<table cellspacing="0" cellpadding="0" border="0" align="center" width="160">
<tbody>
<tr>
<td><center><!--vim--><br />
<style type="text/css"><!--.st1 {color: blue;}.st2 {color: black; text-decoration: none;}--></style>
<table cellspacing="0" cellpadding="2" bordercolor="#990066" border="1" width="470">
<tbody>
<tr>
<td nowrap="nowrap">
<table cellspacing="0" cellpadding="1" border="0" bgcolor="#eeeeee" width="470">
<tbody>
<tr>
<td nowrap="nowrap" width="1%"><a target="_top" href="http://u.webring.com/t/The-Vi-IMproved-Editor-Web-Ring?sid=8"><img height="50" border="0" width="35" alt="The Vi IMproved Editor Web Ring" src="http://mywebpage.netscape.com/pottsdl1/gifs/vim_gindikin_vim_on_fire.gif" /></a><font face="arial" size="-2"><br />
                                                <span class="st2">&copy; </span><a href="http://www.webring.com/"><span class="st1">WebRing Inc.</span></a></font></td>
<td nowrap="nowrap">
<table cellspacing="2" cellpadding="0" border="0" width="100%">
<tbody>
<tr>
<td nowrap="nowrap"><a target="_top" href="http://u.webring.com/t/The-Vi-IMproved-Editor-Web-Ring?sid=8"><span class="st2"><b>The Vi IMproved Editor Web Ring</b></span></a></td>
</tr>
<tr>
<td nowrap="nowrap" colspan="2"><span class="st2"><b><a title="visit previous site in The Vi IMproved Editor Web Ring" target="_top" href="http://u.webring.com/go?ring=vim;sid=8;id=8;prev"><span class="st1">&lt;&lt; Prev</span></a></b> | <a target="_top" href="http://u.webring.com/t/The-Vi-IMproved-Editor-Web-Ring?sid=8"><span title="visit The Vi IMproved Editor Web Ring community pages" class="st1">Ring Hub</span></a> | <a title="join The Vi IMproved Editor Web Ring communiy" target="_top" href="http://u.webring.com/wrman?ring=vim;sid=8;addsite"><span class="st1">Join</span></a> | <b><a title="Rate this site" target="_top" href="http://u.webring.com/go?ring=vim;sid=8;id=8;prvw"><span class="st1">Rate</span></a></b>| <b><a title="go to next site in The Vi IMproved Editor Web Ring" target="_top" href="http://u.webring.com/go?ring=vim;sid=8;id=8;next"><span class="st1">Next &gt;&gt;</span></a></b> </span></td>
</tr>
<tr>
<form action="http://U.webring.com/cgi-bin/Hubsearch?ringsearch" method="post">
                                                                &nbsp;<br />
                                                            </form>
<td nowrap="nowrap" colspan="2">
<input type="text" style="height: 19px;" size="18" name="query" />
<input type="submit" style="height: 19px;" value="Search" name="Submit" />
<input type="hidden" value="vim" name="ring" /></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>                        </center></td>
</tr>
</tbody>
</table>
<p>            <noscript>&lt;center&gt; &lt;table width=&quot;75%&quot; cellpadding=2 cellspacing=0&gt; &lt;tr valign=bottom&gt;&lt;td&gt; &lt;table bgcolor=990066 border=0 width=&quot;75%&quot;&gt;&lt;tr&gt;&lt;td&gt; &lt;table bgcolor=eeeeee cellpadding=6 cellspacing=0 border=0 width=&quot;100%&quot;&gt;&lt;tr&gt;&lt;td align=center&gt; &lt;font face=arial size=-1&gt;This site is a member of WebRing.  To browse visit&lt;/font&gt;&lt;br&gt;&lt;font face=arial size=-2&gt; &lt;a href=&quot;http://ss.webring.com/navbar?f=l&amp;y=oleg66&amp;u=10002161&quot;&gt; http://ss.webring.com/navbar?f=l&amp;y=oleg66&amp;u=10002161 &lt;/a&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;</noscript></td>
</tr>
<tr>
<td class="title" colspan="3"><img height="75" width="524" src="http://www.geocities.com/volontir/images/regex-title.gif" alt="" /></td>
</tr>
<tr>
<td class="title" colspan="3">
<table height="20" cellspacing="2" cellpadding="2" border="0" width="556" class="buttonbar">
<tbody>
<tr>
<td><a href="http://www.geocities.com/volontir/#news">news</a></td>
<td>
<ul>
<li><a href="http://www.geocities.com/volontir/#intro">&nbsp;intro</a></li>
</ul>
</td>
<td>
<ul>
<li><a href="http://www.geocities.com/volontir/#substitute">&nbsp;substitute</a></li>
</ul>
</td>
<td>
<ul>
<li><a href="http://www.geocities.com/volontir/#global">&nbsp;global</a></li>
</ul>
</td>
<td>
<ul>
<li><a href="http://www.geocities.com/volontir/#pattern">&nbsp;patterns</a></li>
</ul>
</td>
<td>
<ul>
<li><a href="http://www.geocities.com/volontir/#examples">&nbsp;examples</a></li>
</ul>
</td>
<td nowrap="nowrap">
<ul>
<li><a href="http://www.geocities.com/volontir/#compare">other flavors</a></li>
</ul>
</td>
<td>
<ul>
<li>&nbsp;<a href="http://www.geocities.com/volontir/#links">links</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="3">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<h1>Contents</h1>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<p><a class="majorhead" href="http://www.geocities.com/volontir/#news">I. News</a><br />
            <a class="majorhead" href="http://www.geocities.com/volontir/#intro">II. Introduction</a><br />
            <a href="http://www.geocities.com/volontir/#whatisvim" class="minorhead">2.1 What is VIM?</a><br />
            <a href="http://www.geocities.com/volontir/#about" class="minorhead">2.2 About this Tutorial</a><br />
            <a href="http://www.geocities.com/volontir/#credits" class="minorhead">2.3 Credits</a><br />
            <a class="majorhead" href="http://www.geocities.com/volontir/#substitute">III. Substitute Command</a><br />
            <a href="http://www.geocities.com/volontir/#substitute" class="minorhead">3.1 Search &amp; Replace</a><br />
            <a href="http://www.geocities.com/volontir/#address" class="minorhead">3.2 Line Ranges &amp; Addressing</a><br />
            <a class="majorhead" href="http://www.geocities.com/volontir/#pattern">IV. Pattern Description </a><br />
            <a href="http://www.geocities.com/volontir/#anchors" class="minorhead">4.1 Anchors</a><br />
            <a href="http://www.geocities.com/volontir/#metacharacters" class="minorhead">4.2 &quot;Escaped&quot; characters          or metacharacters</a><br />
            <a href="http://www.geocities.com/volontir/#Non-Greedy" class="minorhead">4.3 Quantifiers, Greedy and Non-Greedy</a><br />
            <a href="http://www.geocities.com/volontir/#ranges" class="minorhead">4.4 Character ranges</a><br />
            <a href="http://www.geocities.com/volontir/#backreferences" class="minorhead">4.5 Grouping and Backreferences</a><br />
            <a href="http://www.geocities.com/volontir/#alternations" class="minorhead">4.6 Alternations</a><br />
            <a href="http://www.geocities.com/volontir/#precedence" class="minorhead">4.7 Operator Precedence</a><br />
            <a class="majorhead" href="http://www.geocities.com/volontir/#global">V. Global Command</a><br />
            <a href="http://www.geocities.com/volontir/#global%20search" class="minorhead">5.1 Global search and execution</a><br />
            <a href="http://www.geocities.com/volontir/#global%20examples" class="minorhead">5.2 Examples</a><br />
            <a class="majorhead" href="http://www.geocities.com/volontir/#examples">VI. Examples</a><br />
            <a href="http://www.geocities.com/volontir/#tips" class="minorhead">6.1 Tips &amp; Techniques</a><br />
            <a href="http://www.geocities.com/volontir/#contents" class="minorhead">6.2 Creating Outline</a><br />
            <a href="http://www.geocities.com/volontir/#tables" class="minorhead">6.3 Working with Tables</a><br />
            <a class="majorhead" href="http://www.geocities.com/volontir/#compare">VII. Other Regexp Flavors</a><br />
            <a class="majorhead" href="http://www.geocities.com/volontir/#links">VIII. Links</a></p>
</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="news">I. News</a></h1>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">
<ul>
<li>Finally, I&#8217;ve moved this page from City College&#8217;s physlab server,            which is no longer maintained.</li>
<li>VIM 6.0 is now official. A lot of changes and new features were introduced.            I&#8217;ll try to bring this page in a line with the current VIM version.</li>
<li>I no longer support the VIM reference guide. <a href="mailto:sheffner@web.de"><b>Stephan            Heffner</b></a> has voluntereed to update the guide.</li>
</ul>
</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="intro">II. Introduction</a></h1>
</td>
</tr>
<tr>
<td colspan="3">
<h2><a name="whatisvim">2.1 What is VIM?</a></h2>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">
<p>Vim is an improved (in many ways) version of vi, a ubiquitous text editor          found on any UNIX system. VIM was created by <a href="http://www.geocities.com/volontir/images/photos/nyc/pics/linux-bram.jpg">Bram          Moolenaar</a> with a help of other people. It&#8217;s free but if you like it          you can make a charitable contribution to orphans in Uganda.</p>
<p>Vim has its own web site, <a href="http://www.vim.org/"><b>www.vim.org</b></a>          and several <a href="http://www.vim.org/mail.html">mailing lists</a>,          with a wealth of information on every aspect of VIM. Vim was successfully          ported to nearly all existing OS. It is a default editor in many Linux          distributions (e.g. RedHat).</p>
<p>VIM has all features of a modern programmer&#8217;s editor &#8211; macro language,          syntax highlighting, customizable user interface, easy integration with          various IDEs plus a set of features which makes VIM so attractive to its          users: crash recovery, automatic commands, session management.</p>
<p>VIM has a very broad and loyal user base. Over 10 million people have          it installed (counting only Linux users). Estimation is that there are          about half a million people using Vim as their main editor. And this number          is growing.</p>
</td>
</tr>
<tr>
<td colspan="3">
<h2><a name="about">2.2 About this Tutorial</a></h2>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<p>I started this tutorial for one simple reason &#8211; I like regular expressions.          Nothing compares to the satisfaction from a well-crafted regexp which          does exactly what you wanted it to do :-). I hope it&#8217;s passable as a foreword.</p>
<p>Speaking more seriously, regular expressions (or regexps for short) are          tools used to manipulate text and data. They don&#8217;t exist as a standalone          product but usually are a part of some program/utility. The best known          example is UNIX<i> grep, </i>a program to search files for lines that          match certain pattern. The search pattern is described in terms of <i>regular          expressions. </i>You can think of regexps as a specialized pattern language.          Regexps are quite useful and can greatly reduce time it takes to do some          tedious text editing.</p>
<p>(Regexp terminology is largely borrowed from Jeffrey Friedl &quot;Mastering          Regular Expressions.&quot;)</p>
</td>
</tr>
<tr>
<td colspan="3">
<h2><a name="credits">2.3 Credits</a></h2>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">
<p>Many thanks (in no particular order): Benji Fisher, Zdenek Sekera, Preben          &quot;Peppe&quot; Guldberg, Steve Kirkendall, Shaul Karl and all others          who helped me with their comments.</p>
<p>Feel free to send me (<a href="mailto:volontir%20at%20yahoo%20dot%20com"><img border="0" align="absbottom" src="http://www.geocities.com/volontir/images/email.gif" alt="" /></a><b>volontir          at yahoo dot com</b>) your comments. suggestions, examples&#8230;</p>
</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="substitute">III. Substitute Command</a></h1>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="replace">3.1 Search &amp; Replace</a></h2>
<p>So, what can you do with regular expressions? The most common task is          to make replacements in a text following some certain rules. For this          tutorial you need to know VIM search and replace command (S&amp;R) <code>:substitute</code>.          Here is an excerpt from VIM help:</p>
<table cellspacing="3" class="vimdoc">
<tbody>
<tr>
<td colspan="2"><b>:<i>range</i> s[ubstitute]/<i>pattern</i>/<i>string</i>/cgiI</b></td>
</tr>
<tr>
<td colspan="2">For each line in<b> <i>the range</i></b> replace a match              of <i><b>the pattern</b></i> with <i><b>the string</b></i> where:</td>
</tr>
<tr>
<td width="44">
<div align="center"><b>c</b></div>
</td>
<td width="551">Confirm each substitution</td>
</tr>
<tr>
<td width="44">
<div align="center"><b>g</b></div>
</td>
<td width="551">Replace all occurrences in the line (without <b>g </b>-              only first).</td>
</tr>
<tr>
<td width="44">
<div align="center"><b>i</b></div>
</td>
<td height="19" width="551">Ignore case for the pattern.</td>
</tr>
<tr>
<td width="44">
<div align="center"><b>I </b></div>
</td>
<td width="551">Don&#8217;t ignore case for the pattern.</td>
</tr>
</tbody>
</table>
<p>Part of the command word enclosed in the &quot;[&quot; &amp; &quot;]&quot;          can be omitted.</p>
<h2><a name="address">3.2 Range of Operation, Line Addressing and Marks</a></h2>
<p>Before I begin with a pattern description let&#8217;s talk about line addresses          in Vim. Some Vim commands can accept a line range in front of them. By          specifying the line range you restrict the command execution to this particular          part of text only. Line range consists of one or more line specifiers,          separated with a comma or semicolon. You can also mark your current position          in the text typing <code>m<i>l</i></code> , where <i>&quot;l&quot;</i>          can be any letter, and use it later defining the line address.</p>
<table cellspacing="3" width="585" class="vimdoc">
<tbody>
<tr>
<td>
<div align="center"><b>Specifier</b></div>
</td>
<td>
<div align="center"><b>Description</b></div>
</td>
</tr>
<tr>
<td>
<div align="center"><b><i>number</i></b></div>
</td>
<td>an absolute line number</td>
</tr>
<tr>
<td>
<div align="center"><b>. </b></div>
</td>
<td>the current line</td>
</tr>
<tr>
<td>
<div align="center"><b>$</b></div>
</td>
<td>the last line in the file</td>
</tr>
<tr>
<td>
<div align="center"><b>%</b></div>
</td>
<td>the whole file. The same as <b>1,$</b></td>
</tr>
<tr>
<td>
<div align="center"><b>&#8216;<i>t </i></b></div>
</td>
<td>position of mark &quot;t&quot;</td>
</tr>
<tr>
<td>
<div align="center"><b>/<i>pattern</i>[/]</b></div>
</td>
<td>the next line where text<i> &quot;pattern</i>&quot; matches.</td>
</tr>
<tr>
<td>
<div align="center"><b> ?<i>pattern</i>[?] </b></div>
</td>
<td>the previous line where text &quot;<i>pattern</i>&quot; matches</td>
</tr>
<tr>
<td>
<div align="center"><b>\/ </b></div>
</td>
<td>the next line where the previously used search pattern matches</td>
</tr>
<tr>
<td>
<div align="center"><b>\?</b></div>
</td>
<td>the previous line where the previously used search pattern matches</td>
</tr>
<tr>
<td>
<div align="center"><b>\&amp;</b></div>
</td>
<td>the next line where the previously used substitute pattern matches</td>
</tr>
</tbody>
</table>
<p>If no line range is specified the command will operate on the current          line only.</p>
<p>Here are a few examples:</p>
<p><code>10,20 </code></p>
<p>- from 10 to 20 line.</p>
<p>Each may be followed (several times) by &quot;+&quot; or &quot;-&quot;          and an optional number. This number is added or subtracted from the preceding          line number. If the number is omitted, 1 is used.</p>
<p class="pattern"><code>/Section 1/+,/Section 2/-</code></p>
<p>- all lines between <span class="pattern">Section 1</span> and <span class="pattern">Section          2</span>, non-inclusively, i.e. the lines containing <span class="pattern">Section          1</span> and <span class="pattern">Section 2</span> will not be affected.</p>
<p>The <code>/<i>pattern</i>/</code> and <code>?<i>pattern</i>?</code> may          be followed by another address separated by a semicolon. A semicolon between          two search patterns tells Vim to find the location of the first pattern,          then start searching from that location for the second pattern.</p>
<p><code>/Section 1/;/Subsection/-,/Subsection/+</code></p>
<p>- first find <span class="pattern">Section 1</span>, then the first line          with <span class="pattern">Subsection</span>, step one line down (beginning          of the range) and find the next line with <span class="pattern">Subsection</span>,          step one line up (end of the range).</p>
<p>The next example shows how you can reuse you search pattern:</p>
<p><code>:/Section/+ y</code></p>
<p>- this will search for the <span class="pattern">Section</span> line          and yank (copy) one line after into the memory.</p>
<p><code>:// normal p</code></p>
<p>- and that will search for the next <span class="pattern">Section</span>          line and put (paste) the saved text on the next line.</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<div class="tip">
<p><b>Tip 1:</b> frequently you need to do S&amp;R in a text which contains            UNIX file paths &#8211; text strings with slashes (&quot;/&quot;) inside.            Because S&amp;R command uses slashes for pattern/replacement separation            you have to escape every slash in your pattern, i.e. use &quot;\/&quot;            for every &quot;/&quot; in your pattern:</p>
<p><code>s/\/dir1\/dir2\/dir3\/file/dir4\/dir5\/file2/g</code></p>
<p>To avoid this so-called &quot;backslashitis&quot; you can use different            separators in S&amp;R (I prefer &quot;:&quot;)</p>
<p><code>s:/dir1/dir2/dir3/file:/dir4/dir5/file2:g</code></p>
<p><b>Tip 2:</b> You may find these mappings useful (put them in your            <b>.vimrc</b> file)</p>
<p><code>noremap ;; :%s:::g&lt;Left&gt;&lt;Left&gt;&lt;Left&gt;<br />
            noremap ;' :%s:::cg&lt;Left&gt;&lt;Left&gt;&lt;Left&gt;&lt;Left&gt;</code></p>
<p>These mappings save you some keystrokes and put you where you start            typing your search pattern. After typing it you move to the replacement            part , type it and hit return. The second version adds confirmation            flag.</p>
</p></div>
</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="pattern">IV. Pattern Description</a></h1>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="anchors">4.1 Anchors</a></h2>
<p>Suppose you want to replace all occurrences of <span class="pattern">vi</span>          with <span class="pattern">VIM</span>. This can be easily done with</p>
<p><code>s/vi/VIM/g</code></p>
<p>If you&#8217;ve tried this example then you, no doubt, noticed that <span class="pattern">VIM</span>          replaced all occurrences of <span class="pattern">vi</span> even if it&#8217;s          a part of the word (e.g. na<span class="match">vi</span>gator). If we          want to be more specific and replace only whole words <span class="pattern">vi</span>          then we need to correct our pattern. We may rewrite it by putting spaces          around <span class="pattern">vi</span>:</p>
<p><code>s: vi : VIM :g</code></p>
<p>But it will still miss <span class="pattern">vi</span> followed by the          punctuation or at the end of the line/file. The right way is to put special          word boundary symbols &quot;<code>\&lt;</code>&quot; and &quot;<code>\&gt;</code>&quot;          around <span class="pattern">vi</span>.</p>
<p><code>s:\&lt;vi\&gt;:VIM:g</code></p>
<p>The beginning and the end of the line have their own special anchors          &#8211; &quot;<code>^</code>&quot; and &quot;<code>$</code>&quot;, respectively.          So, for all <span class="pattern">vi</span> only at the start of the line:</p>
<p><code>s:^vi\&gt;:VIM:</code></p>
<p>To match the lines where <span class="pattern">vi</span> is the only          word:</p>
<p><code>s:^vi$:VIM:</code></p>
<p>Now suppose you want to replace not only all <span class="pattern">vi</span>          but also <span class="pattern">Vi</span> and <span class="pattern">VI</span>.          There are several ways to do this:</p>
<ul>
<li>probably the simplest way is to put &quot;i&quot; &#8211; ignore case in            a pattern <code>%s:vi:VIM:gi</code></li>
<li>define a class of characters. This is a sequence of characters enclosed            by square brackets &quot;[&quot; and &quot;]&quot;. It matches any character            from this set. So <code>:%s:[Vv]i:VIM:</code> will match <span class="pattern">vi</span>            and <span class="pattern">Vi</span>. More on character ranges in the            following <a href="http://www.geocities.com/volontir/#ranges">section</a>.</li>
</ul>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="metacharacters">4.2 &quot;Escaped&quot; characters or metacharacters</a></h2>
<p>So far our pattern strings were constructed from normal or <i><b>literal          </b></i>text characters. The power of regexps is in the use of <i><b>metacharacters</b>.          </i>These are types of characters which have special meaning inside the          search pattern. With a few exceptions these metacharacters are distinguished          by a &quot;magic&quot; backslash in front of them. The table below lists          some common VIM metacharacters.</p>
<table cellspacing="3" class="vimdoc">
<tbody>
<tr>
<th width="43">
<div align="center"><b>#</b></div>
</th>
<th width="245">
<div align="center"><b>Matching</b></div>
</th>
<th width="46">
<div align="center"><b>#</b></div>
</th>
<th width="225">
<div align="center"><b>Matching</b></div>
</th>
</tr>
<tr>
<td width="43">
<div align="center"><b>.</b></div>
</td>
<td width="245">any character except new line</td>
<td width="46">&nbsp;</td>
<td width="225">&nbsp;</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\s</b></div>
</td>
<td width="245">whitespace character</td>
<td width="46">
<div align="center"><b>\S</b></div>
</td>
<td width="225">non-whitespace character</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\d</b></div>
</td>
<td width="245">digit</td>
<td width="46">
<div align="center"><b>\D</b></div>
</td>
<td width="225">non-digit</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\x</b></div>
</td>
<td width="245">hex digit</td>
<td width="46">
<div align="center"><b>\X</b></div>
</td>
<td width="225">non-hex digit</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\o</b></div>
</td>
<td width="245">octal digit</td>
<td width="46">
<div align="center"><b>\O</b></div>
</td>
<td width="225">non-octal digit</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\h</b></div>
</td>
<td width="245">head of word character (a,b,c&#8230;z,A,B,C&#8230;Z and _)</td>
<td width="46">
<div align="center"><b>\H</b></div>
</td>
<td width="225">non-head of word character</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\p</b></div>
</td>
<td width="245">printable character</td>
<td width="46">
<div align="center"><b>\P</b></div>
</td>
<td width="225">like <b>\p</b>, but excluding digits</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\w</b></div>
</td>
<td width="245">word character</td>
<td width="46">
<div align="center"><b>\W</b></div>
</td>
<td width="225">non-word character</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\a</b></div>
</td>
<td width="245">alphabetic character</td>
<td width="46">
<div align="center"><b>\A</b></div>
</td>
<td width="225">non-alphabetic character</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\l</b></div>
</td>
<td width="245">lowercase character</td>
<td width="46">
<div align="center"><b>\L</b></div>
</td>
<td width="225">non-lowercase character</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\u</b></div>
</td>
<td width="245">uppercase character</td>
<td width="46">
<div align="center"><b>\U</b></div>
</td>
<td width="225">non-uppercase character</td>
</tr>
</tbody>
</table>
<p>So, to match a date like 09/01/2000 you can use (assuming you don&#8217;t use          &quot;/&quot; as a separator in the S&amp;R)<code> </code></p>
<p><code>\d\d/\d\d/\d\d\d\d</code></p>
<p>To match 6 letter word starting with a capital letter</p>
<p><code>\u\w\w\w\w\w</code></p>
<p>Obviously, it is not very convenient to write <code>\w</code> for any          character in the pattern &#8211; what if you don&#8217;t know how many letters in          your word? This can be helped by introducing so-called <i>quantifiers</i>.</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="Non-Greedy">4.3 Quantifiers, Greedy and Non-Greedy</a></h2>
<p>Using quantifiers you can set how many times certain part of you pattern          should repeat by putting the following after your pattern:</p>
<table cellspacing="3" width="585" class="vimdoc">
<tbody>
<tr>
<th>
<div align="center"><b>Quantifier</b></div>
</th>
<th>
<div align="center"><b>Description</b></div>
</th>
</tr>
<tr>
<td>
<div align="center"><b>*</b></div>
</td>
<td>matches 0 or more of the preceding characters, ranges or metacharacters              .* matches everything including empty line</td>
</tr>
<tr>
<td>
<div align="center"><b>\+</b></div>
</td>
<td>matches 1 or more of the preceding characters&#8230;</td>
</tr>
<tr>
<td>
<div align="center"><b>\= </b></div>
</td>
<td>matches 0 or 1 more of the preceding characters&#8230;</td>
</tr>
<tr>
<td>
<div align="center"><b>\{n,m}</b></div>
</td>
<td>matches from n to m of the preceding characters&#8230;</td>
</tr>
<tr>
<td>
<div align="center"><b>\{n}</b></div>
</td>
<td>matches exactly n times of the preceding characters&#8230;</td>
</tr>
<tr>
<td>
<div align="center"><b>\{,m}</b></div>
</td>
<td>matches at most m (from 0 to m) of the preceding characters&#8230;</td>
</tr>
<tr>
<td>
<div align="center"><b>\{n,}</b></div>
</td>
<td>matches at least n of of the preceding characters&#8230;</td>
</tr>
<tr>
<td colspan="2">
<div align="center">where <b>n</b> and <b>m</b> are positive integers                (&gt;0)</div>
</td>
</tr>
</tbody>
</table>
<p>Now it&#8217;s much easier to define a pattern that matches a word of <i>any          </i> length <code>\u\w\+</code>.</p>
<p>These quantifiers are <i>greedy</i> &#8211; that is your pattern will try to          match <i> <b>as much text as</b></i> possible. Sometimes it presents a          problem. Let&#8217;s consider a typical example &#8211; define a pattern to match          delimited text, i.e. text enclosed in quotes, brackets, etc. Since we          don&#8217;t know what kind of text is inside the quotes we&#8217;ll use</p>
<p><code>/&quot;.*&quot;/</code></p>
<p>But this pattern will match <i>everything</i> between the first &quot;          and the last &quot; in the following line:</p>
<p><code>this file is normally <span class="match">&quot;$VIM/.gvimrc&quot;. You          can check this with &quot;:version&quot;</span>.</code></p>
<p>This problem can be resolved by using non-greedy quantifiers:</p>
<table cellspacing="3" width="585" class="vimdoc">
<tbody>
<tr>
<td>
<div align="center"><b>Quantifier</b></div>
</td>
<td>
<div align="center"><b>Description</b></div>
</td>
</tr>
<tr>
<td>
<div align="center"><b>\{-}</b></div>
</td>
<td>matches 0 or more of the preceding atom, as few as possible</td>
</tr>
<tr>
<td>
<div align="center"><b>\{-n,m} </b></div>
</td>
<td>matches 1 or more of the preceding characters&#8230;</td>
</tr>
<tr>
<td>
<div align="center"><b>\{-n,}</b></div>
</td>
<td>matches at lease or more of the preceding characters&#8230;</td>
</tr>
<tr>
<td>
<div align="center"><b>\{-,m} </b></div>
</td>
<td>matches 1 or more of the preceding characters&#8230;</td>
</tr>
<tr>
<td colspan="2">
<div align="center">where <b>n</b> and <b>m</b> are positive integers                (&gt;0)</div>
</td>
</tr>
</tbody>
</table>
<p>Let&#8217;s use <code>\{-}</code> in place of <code>*</code> in our pattern.          So, now <code>&quot;.\{-}&quot;</code> will match the first quoted text:</p>
<p><code>this file is normally <span class="match">&quot;$VIM/gvimrc&quot;</span>.          You can check this with &quot;:version&quot;.</code></p>
<p><code>.\{-}</code> pattern is not without surprises. Look what will happen          to the following text after we apply:</p>
<p><code>:s:.\{-}:_:g</code></p>
<p>Before:</p>
<p><code>n and m are decimal numbers between</code></p>
<p>After:</p>
<p><code>_n_ _a_n_d_ _m_ _a_r_e_ _d_e_c_i_m_a_l_ _n_u_m_b_e_r_s_ _b_e_t_w_e_e_n_</code></p>
<p>&quot;As few as possible&quot; applied here means zero character replacements.          However match <b>does occur</b> between characters! To explain this behavior          I quote Bram himself:</p>
<p><cite>Matching zero characters is still a match. Thus it will replace          zero characters with a &quot;_&quot;. And then go on to the next position, where          it will match again. </cite></p>
<p><cite>It&#8217;s true that using &quot;\{-}&quot; is mostly useless. It works this way          to be consistent with &quot;*&quot;, which also matches zero characters. There are          more useless ones: &quot;x\{-1,}&quot; always matches one x. You could just use          &quot;x&quot;. More useful is something like &quot;x\{70}&quot;. The others are just consistent          behavior: &#8230;, &quot;x\{-3,}&quot;, &quot;x\{-2,}&quot;, &quot;x\{-1,}. </cite></p>
<p><cite>- Bram </cite></p>
<p>But what if we want to match only the second occurrence of quoted text?          Or we want to replace only a part of the quoted text keeping the rest          untouched? We will need <i>grouping</i> and <i>backreferences.</i> But          before let&#8217;s talk more about character ranges.</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="ranges">4.4 Character ranges</a></h2>
<p>Typical character ranges:</p>
<p><code>[012345]</code> will match any of the numbers inside the brackets.          The same range can be written as <code>[0-5]</code>, where dash indicates          a range of characters in ASCII order. Likewise, we can define the range          for all lowercase letters: <code>[a-z]</code>, for all letters: <code>[a-zA-Z]</code>,          letters and digits: <code>[0-9a-zA-Z]</code> etc. Depending on your system          locale you can define range which will include characters like &agrave;,          &Ouml;, &szlig; and other non ASCII characters.</p>
<p>Note that the range represents just <i>one character</i> in the search          pattern, that is <code>[0123]</code> and <code>0123</code> are not the          same. Likewise the order (with a few exceptions) is not important: <code>[3210]</code>          and <code>[0123]</code> are the same character ranges, while <code>0123</code>          and <code>3210</code> are two different patterns. Watch what happens when          we apply</p>
<p><code>s:[65]:Dig:g</code></p>
<p>to the following text:</p>
<p>Before:</p>
<p><code>High <span class="match">65</span> to 70. Southeast wind around          10</code></p>
<p>After:</p>
<p><code>High <span class="replace">DigDig</span> to 70. Southeast wind          around 10</code></p>
<p>and now:</p>
<p><code>s:65:Dig:g</code></p>
<p>Before:</p>
<p><code>High <span class="match">65</span> to 70. Southeast wind around          10</code></p>
<p>After:</p>
<p><code>High <span class="replace">Dig</span> to 70. Southeast wind around          10</code></p>
<p>Sometimes it&#8217;s easier to define the characters you don&#8217;t want to match.          This is done by putting a negation sign <code>&quot;^&quot;</code> (caret)          as a first character of the range</p>
<p>/<code>[^A-Z]</code>/</p>
<p>- will match <i>any character</i> except capital letters. We can now          rewrite our pattern for quoted text using</p>
<p><code>/&quot;[^&quot;]\+&quot;</code>/</p>
<p>Note: inside the [ ] all metacharacters behave like ordinary characters.          If you want to include &quot;-&quot; (dash) in your range put it first</p>
<p><code>/[-0-9]/</code></p>
<p>- will match all digits <i>and </i> -. &quot;^&quot; will lose its special          meaning if it&#8217;s not the first character in the range.</p>
<p>Now, let&#8217;s have some real life example. Suppose you want to run a grammar          check on your file and find all places where new sentence does not start          with a capital letter. The pattern that will catch this:</p>
<p><code>\.\s\+[a-z] </code></p>
<p>- a period followed by one or more blanks and a lowercase word. We know          how to find an error, now let&#8217;s see how we can correct it. To do this          we need some ways to remember our matched pattern and recall it later.          That is exactly what <i>backreferences</i> are for.</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="backreferences">4.5 Grouping and Backreferences</a></h2>
<p>You can group parts of the pattern expression enclosing them with &quot;<code>\(</code>&quot;          and &quot;<code>\)</code>&quot; and refer to them inside the replacement          pattern by their special number <code>\1, \2 ... \9</code>. Typical example          is swapping first two words of the line:</p>
<p>            <code>s:\(\w\+\)\(\s\+\)\(\w\+\):\3\2\1:</code></p>
<p>where <code>\1</code> holds the first word, <code>\2</code> &#8211; any number          of spaces or tabs in between and <code>\3</code> &#8211; the second word. How          to decide what number holds what pair of <code>\(\)</code> ? &#8211; count opening          &quot;<code>\(</code>&quot; from the left.</p>
<h2>Replacement Part of :substitute</h2>
<p>Replacement part of the S&amp;R has its own special characters which          we are going to use to fix grammar:</p>
<table cellspacing="3" class="vimdoc">
<tbody>
<tr>
<td width="43">
<div align="center"><b>#</b></div>
</td>
<td width="245">
<div align="center"><b>Meaning</b></div>
</td>
<td width="46">
<div align="center"><b>#</b></div>
</td>
<td width="225">
<div align="center"><b>Meaning</b></div>
</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>&amp;</b></div>
</td>
<td width="245">the whole matched pattern</td>
<td width="46">
<div align="center"><b>\L</b></div>
</td>
<td width="225">the following characters are made lowercase</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\0</b></div>
</td>
<td width="245">the whole matched pattern</td>
<td width="46">
<div align="center"><b>\U</b></div>
</td>
<td width="225">the following characters are made uppercase</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\1</b></div>
</td>
<td width="245">the matched pattern in the first pair of \(\)</td>
<td width="46">
<div align="center"><b>\E</b></div>
</td>
<td width="225">end of \U and \L</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\2</b></div>
</td>
<td width="245">the matched pattern in the second pair of \(\)</td>
<td width="46">
<div align="center"><b>\e</b></div>
</td>
<td width="225">end of \U and \L</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>&#8230;</b></div>
</td>
<td width="245">&#8230;</td>
<td width="46">
<div align="center"><b>\r</b></div>
</td>
<td width="225">split line in two at this point</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>\9</b></div>
</td>
<td width="245">the matched pattern in the ninth pair of \(\)</td>
<td width="43">
<div align="center"><b>\l </b></div>
</td>
<td width="245">next character made lowercase</td>
</tr>
<tr>
<td width="43">
<div align="center"><b>~</b></div>
</td>
<td width="245">the previous substitute string</td>
<td width="43">
<div align="center"><b>\u</b></div>
</td>
<td width="245">next character made uppercase</td>
</tr>
</tbody>
</table>
<p>Now the full S&amp;R to correct non-capital words at the beginning of          the sentences looks like</p>
<p><code>s:\([.!?]\)\s\+\([a-z]\):\1&nbsp;&nbsp;\u\2:g</code></p>
<p>We have corrected our grammar and as an extra job we replaced variable          number of spaces between punctuation and the first letter of the next          sentence with exactly two spaces.</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="alternations">4.6 Alternations</a></h2>
<p>Using &quot;<code>\|</code>&quot; you can combine several expressions          into one which matches any of its components. The first one matched will          be used.</p>
<p><code>\(Date:\|Subject:\|From:\)\(\s.*\)</code></p>
<p>            will parse various mail headings and their contents into \1 and \2, respectively.        The thing to remember about VIM alternation that it is not <i>greedy. </i>        It won&#8217;t search for the longest possible match, it will use the first that        matched. That means that the order of the items in the alternation is important!</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<div class="tip">
<p><b>Tip 3:</b> Quick mapping to put \(\) in your pattern string</p>
<p><code>cmap ;\ \(\)&lt;Left&gt;&lt;Left&gt;</code></p>
</p></div>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="precedence">4.7 Regexp Operator Precedence</a></h2>
<p>As in arithmetic expressions, regular expressions are executed in a certain          order of precedence. Here the table of precedence, from highest to lowest:</p>
<table cellspacing="3" class="vimdoc">
<tbody>
<tr>
<td width="94">
<div align="center"><b>Precedence</b></div>
</td>
<td width="192">
<div align="center"><b>Regexp</b></div>
</td>
<td width="261">
<div align="center"><b>Description</b></div>
</td>
</tr>
<tr>
<td width="94">
<div align="center"><b>1</b></div>
</td>
<td width="192">
<div align="center"><b>\( \)</b></div>
</td>
<td width="261">
<div align="center">grouping</div>
</td>
</tr>
<tr>
<td width="94">
<div align="center"><b>2</b></div>
</td>
<td width="192">
<div align="center"><b>\=,\+,*,\{n} etc.</b></div>
</td>
<td width="261">
<div align="center">quantifiers</div>
</td>
</tr>
<tr>
<td width="94">
<div align="center"><b>3</b></div>
</td>
<td width="192">
<div align="center"><b>abc\t\.\w</b></div>
</td>
<td width="261">
<div align="center">sequence of characters/ metacharacters, not containing                quantifiers or grouping operators</div>
</td>
</tr>
<tr>
<td width="94">
<div align="center"><b>4</b></div>
</td>
<td width="192">
<div align="center"><b>\|</b></div>
</td>
<td width="261">
<div align="center">alternation</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="global">V. Global Command</a></h1>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="global search">5.1 Global search and execution</a></h2>
<p>I want to introduce another quite useful and powerful Vim command which          we&#8217;re going to use later</p>
<table cellspacing="3" class="vimdoc">
<tbody>
<tr>
<td colspan="2"><b>:<i>range</i> g[lobal][!]/<i>pattern</i>/<i>cmd</i></b></td>
</tr>
<tr>
<td colspan="2">Execute the Ex command <b><i>cmd</i></b> (default &quot;<b>:p</b>&quot;)              on the lines within [<b><i>range</i></b>] where <b><i>pattern</i></b>              matches. If <b><i>pattern</i></b> is preceded with a <b>!</b> &#8211; only              where match <b>does not</b> occur.</td>
</tr>
</tbody>
</table>
<p>The global commands work by first scanning through the [<i>range</i>]          of of the lines and marking each line where a match occurs. In a second          scan the [<i>cmd</i>] is executed for each marked line with its line number          prepended. If a line is changed or deleted its mark disappears. The default          for the [<i>range</i>] is the whole file.</p>
<p>Note: Ex commands are all commands you are entering on the Vim command          line like <code>:s[ubstitute], :co[py] , :d[elete], :w[rite] </code>etc.          Non-Ex commands (normal mode commands) can be also executed via</p>
<p><code>:norm[al]<i>non-ex command</i></code></p>
<p>mechanism.</p>
<h2><a name="global examples">5.2 Examples</a></h2>
<p>Some examples of <code>:global</code> usage:</p>
<p><code>:g/^$/ d</code></p>
<p>- delete all empty lines in a file</p>
<p><code>:g/^$/,/./-j</code></p>
<p>- reduce multiple blank lines to a single blank</p>
<p><code>:10,20g/^/ mo 10</code></p>
<p>- reverse the order of the lines starting from the line 10 up to the          line 20.</p>
<p>Here is a modified example from <a href="http://www.networkcomputing.com/unixworld/tutorial/009/009.html">Walter          Zintz vi tutorial</a>:</p>
<p><code>:'a,'b g/^Error/ . w &gt;&gt; errors.txt</code></p>
<p>- in the text block marked by <code>'a</code> and <code>'b </code>find          all the lines starting with <span class="pattern">Error</span> and copy          (append) them to &quot;errors.txt&quot; file.<b> Note:</b> . (current          line address) in front of the <code>w</code> is very important, omitting          it will cause <code>:write</code> to write the whole file to &quot;errors.txt&quot;          for every <span class="pattern">Error</span> line found.</p>
<p>You can give multiple commands after <code>:global </code>using &quot;|&quot;          as a separator. If you want to use &quot;|&#8217; in an argument, precede it          with &quot;\&#8217;. Another example from Zintz tutorial:</p>
<p><code>:g/^Error:/ copy $ | s /Error/copy of the error/</code></p>
<p>- will copy all <span class="pattern">Error</span> line to the end of          the file and then make a substitution in the copied line. Without giving          the line address <code>:s</code> will operate on the current line, which          is the newly copied line.</p>
<p><code>:g/^Error:/ s /Error/copy of the error/ | copy $</code></p>
<p>- here the order is reversed: first modify the string then copy to the          end.</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="examples">VI. Examples</a></h1>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="tips">6.1 Tips and Techniques</a></h2>
<p>A collection of some useful S&amp;R tips:</p>
<p>(1) sent by Antonio Colombo:</p>
<p><cite>&quot;a simple regexp I use quite often to clean up a text: it          drops the blanks at the end of the line:&quot;</cite></p>
<p><code> s:\s*$::</code></p>
<p><cite>or (to avoid acting on all lines): </cite></p>
<p><code>s:\s\+$::</code></p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="contents">6.2 Creating outline</a></h2>
<p>For this example you need to know a bit of HTML. We want to make a table          of contents out of <code>h1</code> and <code>h2</code> headings, which          I will call majors and minors. HTML heading <code>h1</code> is a text          enclosed by <code>&lt;h1&gt;</code> tags as in <code>&lt;h1&gt;Heading&lt;/h1&gt;</code>.</p>
<p>(1) First let&#8217;s make named anchors in all headings, i.e. put <code>&lt;h1&gt;&lt;a          name=&quot;anchor&quot;&gt;Heading&lt;/a&gt;&lt;/h1&gt;</code> around          all headings. The <code>&quot;anchor</code>&quot; is a unique identifier          of this particular place in HTML document. The following S&amp;R does          exactly this:</p>
<p><code> :s:\(&lt;h[12]&gt;\)\(.*\s\+\([-a-zA-Z]\+\)\)\s*\(&lt;/h[12]&gt;\):\1&lt;a          name=&quot;\3&quot;&gt;\2&lt;/a&gt;\4:</code></p>
<p><b>Explanation:</b> the first pair of <code>\(\)</code> saves the opening          tag (<code>h1</code> or <code>h2</code>) to the <code>\1</code>, the second          pair saves all heading text before the closing tag, the third pair saves          the last word in the heading which we will later use for &quot;anchor&quot;          and the last pair saves the closing tag. The replacement is quite obvious          &#8211; we just reconstruct a new &quot;named&quot; heading using <code>\1-\4</code>          and link tag <code>&lt;a&gt;.</code></p>
<p>(2) Now let&#8217;s copy all headings to one place:</p>
<p><code>:%g/&lt;h[12]&gt;/ t$</code></p>
<p>This command searches our file for the lines starting with <code>&lt;h1&gt;</code>          or <code>&lt;h2&gt;</code> and copies them to the end of the file. Now          we have a bunch of lines like:</p>
<p><code>&lt;h1&gt;&lt;a name=&quot;anchor1&quot;&gt;Heading1&gt;&lt;/a&gt;&lt;/h1&gt;<br />
            &lt;h2&gt;&lt;a name=&quot;anchor2&quot;&gt;Heading2&gt;&lt;/a&gt;&lt;/h2&gt;<br />
            &lt;h2&gt;&lt;a name=&quot;anchor3&quot;&gt;Heading3&gt;&lt;/a&gt;&lt;/h2&gt;<br />
            ..........................<br />
            &lt;h1&gt;&lt;a name=&quot;anchorN&quot;&gt;HeadingN&gt;&lt;/a&gt;&lt;/h1&gt;</code></p>
<p>First, we want to convert all <code>name=&quot;</code> to <code>href=&quot;#</code>          in order to link table entries to their respective places in the text:</p>
<p><code>s:name=&quot;:href=&quot;#:</code></p>
<p>Second, we want our <code>h1</code> entries look different from <code>h2</code>.          Let&#8217;s define CSS classes &quot;majorhead&quot; and &quot;minorhead&quot;          and do the following:</p>
<p><code>g/&lt;h1&gt;/ s:&lt;a:&amp; class=&quot;majorhead&quot;:<br />
            g/&lt;h2&gt;/ s:&lt;a:&amp; class=&quot;minorhead&quot;: </code></p>
<p>Now our entries look like:</p>
<p><code>&lt;h1&gt;&lt;a class=&quot;majorhead&quot; name=&quot;anchor1&quot;&gt;Heading1&gt;&lt;/a&gt;&lt;/h1&gt;<br />
            &lt;h2&gt;&lt;a class=&quot;minorhead&quot; name=&quot;anchor2&quot;&gt;Heading2&gt;&lt;/a&gt;&lt;/h2&gt;</code></p>
<p>We no longer need <code>h1</code> and <code>h2</code> tags:</p>
<p><code>s:&lt;h[21]&gt;::</code></p>
<p>and replace closing tags with breaklines <code>&lt;br&gt;</code></p>
<p><code>s:/h[21]:br:</code></p>
<p><code>&lt;a class=&quot;majorhead&quot; name=&quot;anchor1&quot;&gt;Heading1&gt;&lt;/a&gt;&lt;br&gt;<br />
            &lt;a class=&quot;minorhead&quot; name=&quot;anchor2&quot;&gt;Heading2&gt;&lt;/a&gt;&lt;br&gt;</code></p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<h2><a name="tables">6.3 Working with Tables</a></h2>
<p>Quite often you have to work with a text organized in tables/columns.          Consider, for example, the following text</p>
<table border="0" align="center" width="500">
<tbody>
<tr>
<td>
<div align="center">Asia</div>
</td>
<td>
<div align="center">America</div>
</td>
<td>
<div align="center">Africa</div>
</td>
<td>
<div align="center">Europe</div>
</td>
</tr>
<tr>
<td>
<div align="center">Africa</div>
</td>
<td>
<div align="center">Europe</div>
</td>
<td>
<div align="center">Europe</div>
</td>
<td>
<div align="center">Africa</div>
</td>
</tr>
<tr>
<td>
<div align="center">Europe</div>
</td>
<td>
<div align="center">Asia</div>
</td>
<td>
<div align="center">Europe</div>
</td>
<td>
<div align="center">Europe</div>
</td>
</tr>
</tbody>
</table>
<p>Suppose we want to change all &quot;Europe&quot; cells in the third column          to &quot;Asia&quot;:</p>
<p><code>:%s:\(\(\w\+\s\+\)\{2}\)Europe:\1Asia:</code></p>
<table border="0" align="center" width="500">
<tbody>
<tr>
<td>
<div align="center">Asia</div>
</td>
<td>
<div align="center">America</div>
</td>
<td>
<div align="center">Africa</div>
</td>
<td>
<div align="center">Europe</div>
</td>
</tr>
<tr>
<td>
<div align="center">Africa</div>
</td>
<td>
<div align="center">Europe</div>
</td>
<td>
<div align="center" class="replace">Asia</div>
</td>
<td>
<div align="center">Africa</div>
</td>
</tr>
<tr>
<td>
<div align="center">Europe</div>
</td>
<td>
<div align="center">Asia</div>
</td>
<td>
<div align="center" class="replace">Asia</div>
</td>
<td>
<div align="center">Europe</div>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>To swap the first and the last columns:</p>
<p><code>:%s:\(\w\+\)\(.*\s\+\)\(\w\+\)$:\3\2\1:</code></p>
<table border="0" align="center" width="500">
<tbody>
<tr>
<td class="replace">
<div align="center">Europe</div>
</td>
<td>
<div align="center">America</div>
</td>
<td>
<div align="center">Africa</div>
</td>
<td class="replace">
<div align="center">Asia</div>
</td>
</tr>
<tr>
<td class="replace">
<div align="center">Africa</div>
</td>
<td>
<div align="center">Europe</div>
</td>
<td>
<div align="center">Europe</div>
</td>
<td class="replace">
<div align="center">Africa</div>
</td>
</tr>
<tr>
<td class="replace">
<div align="center">Europe</div>
</td>
<td>
<div align="center">Asia</div>
</td>
<td>
<div align="center">Europe</div>
</td>
<td class="replace">
<div align="center">Europe</div>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>To be continued&#8230;</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="compare">VII. Other Regexp Flavors</a></h1>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<p>Here I would like to compare Vim&#8217;s regexp implementation with others,          in particular, Perl&#8217;s. You can&#8217;t talk about regular expressions without          mentioning Perl.</p>
<p>(with a help from <a href="mailto:skirkendall@uswest.net">Steve Kirkendall</a>)          The main differences between Perl and Vim are:</p>
<ul>
<li>Perl doesn&#8217;t require backslashes before most of its operators. Personally,            I think it makes regexps more readable &#8211; the less backlashes are there            the better.</li>
<li>Perl allows you to convert any quantifier into a non-greedy version            by adding an extra ? after it. So *? is a non-greedy *.</li>
<li>Perl supports a lots of weird options that can be appended to the            regexp, or even embedded in it.</li>
<li>You can also embed variable names in a Perl regular expression. Perl            replaces the name with its value; this is called &quot;variable interpolation&quot;.</li>
</ul>
</td>
</tr>
<tr>
<td colspan="3">
<h1><a name="links">VIII. Links</a></h1>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<p>Read VIM documentation about pattern and searching. To get this type          &quot;:help pattern&quot; in VIM normal mode.</p>
<p>There are currently two books on the market that deal with VIM regular          expressions:</p>
<ul>
<li><b><a href="http://www.oreilly.com/catalog/vi6/">&quot;Learning the            vi Editor&quot;</a></b> by Linda Lamb and Arnold Robbins.</li>
<li><b>&quot;<a href="http://www.oualline.com/">vi Improved &#8211; VIM</a>&quot;</b> by Steve Oualline</li>
</ul>
<p>Definitive reference on regular expressions is Jeffrey Friedl&#8217;s <b><a href="http://www.oreilly.com/catalog/regex/chapter/ch04.html">&quot;Mastering          Regular Expressions&quot;</a></b> published by O&#8217;Reilly &amp; Associates,          but it mostly deals with Perl regular expressions. O&#8217;Reilly has one of          the book chapters available online.</p>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="297">
<div align="left"><a href="http://us.geocities.yahoo.com/gb/sign?member=volontir"><font face="Arial, Helvetica, sans-serif" size="-1"><b>Sign          Guestbook</b></font></a></div>
</td>
<td width="298">
<div align="right"><a href="http://us.geocities.yahoo.com/gb/view?member=volontir"><font size="-1"><b>View          Guestbook</b></font></a><b><font size="-1">&nbsp;</font></b></div>
</td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="597" colspan="2">
<hr noshade="noshade" />
            </td>
</tr>
<tr>
<td width="29">&nbsp;</td>
<td width="297">
<table cellspacing="0" cellpadding="1" border="0" bgcolor="#660066" width="1%">
<tbody>
<tr>
<td>
<table cellspacing="0" cellpadding="3" border="0" bgcolor="#eeeeee" width="1%">
<tbody>
<tr>
<td width="1%"><a href="http://us.geocities.yahoo.com/pstats/volontir"><img height="14" border="0" width="14" alt="See who's visiting this page." src="http://pic.geocities.com/us/i/geo/ao/pstat.gif" /></a></td>
<td nowrap="nowrap"><font face="arial" size="-2"><a href="http://us.geocities.yahoo.com/pstats/volontir">View                    Page Stats</a></font></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td width="298" class="footer">Copyright &copy; 2000-2001, <a href="mailto:volontir%20at%20yahoo%20dot%20com">Oleg  			 Raisky</a>. Last update: Sun 27 2002</td>
</tr>
</tbody>
</table>
<p><!-- text below generated by server. PLEASE REMOVE --><br />
<script src="http://us.i1.yimg.com/us.yimg.com/i/mc/mc.js" language="JavaScript" type="text/javascript"></script><br />
<script src="http://us.geocities.com/js_source/geov2.js" language="JavaScript" type="text/javascript"></script><br />
<script language="javascript" type="text/javascript">geovisit();</script><br />
<img border="0" src="http://visit.geocities.com/visit.gif?&amp;r=http%3A//www.geocities.com/volontir/%3F200915&amp;b=Netscape%205.0%20%28Windows%3B%20es-ES%29&amp;s=1024x768&amp;o=Win32&amp;c=16&amp;j=true&amp;v=1.2" alt="" /> <noscript>&lt;img src=&quot;http://visit.geocities.com/visit.gif?1012147342&quot; border=0 width=1 height=1&gt;</noscript> <img height="1" width="1" alt="1" src="http://geo.yahoo.com/serv?s=76001067&amp;t=1012147342" /> <!-- text below generated by server. PLEASE REMOVE --><br />
<script src="http://us.i1.yimg.com/us.yimg.com/i/mc/mc.js" language="JavaScript" type="text/javascript"></script><br />
<script src="http://us.js2.yimg.com/us.js.yimg.com/lib/smb/js/hosting/cp/js_source/geov2_001.js" language="JavaScript" type="text/javascript"></script><br />
<script language="javascript" type="text/javascript">geovisit();</script><br />
<noscript>&lt;img src=&quot;http://visit.geocities.yahoo.com/visit.gif?us1253033119&quot; alt=&quot;setstats&quot; border=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;</noscript> <img height="1" width="1" alt="1" src="http://geo.yahoo.com/serv?s=76001067&amp;t=1253033119&amp;f=us-w6" /></p>
]]></content:encoded>
			<wfw:commentRss>http://smultron.es/2009/09/expresiones-regulares-para-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

