logoExtra: mostrarme

Descripción: Código del fichero "diario.jocker.php".


A continuación mostramos los apuntes asociados a este extra:

Metamorfosis con dos ficheros y una tabla
Para reparar los errores mostrados en el apunte anterior teníamos diferentes opciones que hemos aplicado inmediatamente: reemplazamos el enlace hacia un ".txt" por un comodín (mostrar) que cumple esa misma función, e implementamos una solución al error 404 modificando nuestro fichero ".htaccess".
Probador web
Poco a poco estamos recuperando las viejas páginas de "pepemolina.com" para adjuntarlas a la sección "Otras páginas del dominio" en la zona derecha de este diario. El caso más reciente es el "Probador de script".
// Descripción para sindicación:
/*
    [rss]Código del fichero "diario.jocker.php".[/rss]
*/
$fuente = file_get_contents("diario.jocker.php");
/*
ob_start();
    highlight_string($fuente);
$codigo = ob_get_clean();
*/
$codigo = <<< mentirijilla

<code><span style="color: #000000">
<span style="color: #0000BB">&lt;?
<br />&nbsp;&nbsp;&nbsp;&nbsp;session_start</span><span style="color: #007700">();
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$css&nbsp;</span><span style="color: #007700">=&nbsp;&lt;&lt;&lt;&nbsp;css
<br /></span><span style="color: #DD0000">*&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;margin:&nbsp;0;
<br />&nbsp;&nbsp;&nbsp;&nbsp;padding:&nbsp;0;
<br />}
<br />
<br /></span><span style="color: #007700">css;
<br />
<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">\$_GET</span><span style="color: #007700">[</span><span style="color: #DD0000">"extra"</span><span style="color: #007700">]))&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include(</span><span style="color: #DD0000">\$fichero_config</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$conexion&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_connect</span><span style="color: #007700">(</span><span style="color: #0000BB">\$host</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">\$usuario</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">\$clave</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">\$conexion</span><span style="color: #007700">)&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">mysql_select_db</span><span style="color: #007700">(</span><span style="color: #0000BB">\$basededatos</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">\$conexion</span><span style="color: #007700">))&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"select&nbsp;descripcion&nbsp;from&nbsp;</span><span style="color: #0000BB">\$tabla_extras</span><span style="color: #DD0000">&nbsp;where&nbsp;nombre='</span><span style="color: #007700">{</span><span style="color: #0000BB">\$_GET</span><span style="color: #007700">[</span><span style="color: #0000BB">extra</span><span style="color: #007700">]}</span><span style="color: #DD0000">'"</span><span style="color: #007700">;

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$res&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_query</span><span style="color: #007700">(</span><span style="color: #0000BB">\$sql</span><span style="color: #007700">);

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">\$res</span><span style="color: #007700">)&nbsp;&nbsp;&nbsp;&nbsp;{

<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">mysql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">\$res</span><span style="color: #007700">)&nbsp;&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;&nbsp;&nbsp;&nbsp;{

<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$dato&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">mysql_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">\$res</span><span style="color: #007700">);

<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">file_put_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">\$include_extras</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"&lt;?php&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">\$dato</span><span style="color: #007700">[</span><span style="color: #DD0000">"descripcion"</span><span style="color: #007700">]}</span><span style="color: #DD0000">;&nbsp;?&gt;"</span><span style="color: #007700">);

<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;include(</span><span style="color: #DD0000">\$include_extras</span><span style="color: #007700">);

<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;</span><span style="color: #0000BB">\$body&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"No&nbsp;existe&nbsp;</span><span style="color: #007700">{</span><span style="color: #0000BB">\$_GET</span><span style="color: #007700">[</span><span style="color: #0000BB">extra</span><span style="color: #007700">]}</span><span style="color: #DD0000">..."</span><span style="color: #007700">;

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;</span><span style="color: #0000BB">\$body&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"ha&nbsp;ocurrido&nbsp;un&nbsp;error..."</span><span style="color: #007700">;

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;</span><span style="color: #0000BB">\$body&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"ha&nbsp;ocurrido&nbsp;un&nbsp;error..."</span><span style="color: #007700">;

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;</span><span style="color: #0000BB">\$body&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"ha&nbsp;ocurrido&nbsp;un&nbsp;error..."</span><span style="color: #007700">;

<br />&nbsp;&nbsp;&nbsp;&nbsp;}

<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">\$css</span><span style="color: #007700">))&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$style&nbsp;</span><span style="color: #007700">=&lt;&lt;&lt;&nbsp;style
<br /></span><span style="color: #DD0000">&lt;style&nbsp;type="text/css"&nbsp;&gt;
<br /></span><span style="color: #0000BB">\$css</span><span style="color: #DD0000">
<br />
<br />&lt;/style&gt;
<br />
<br /></span><span style="color: #007700">style;
<br />

<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">\$js</span><span style="color: #007700">))&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$script&nbsp;</span><span style="color: #007700">=&lt;&lt;&lt;&nbsp;script
<br /></span><span style="color: #DD0000">&lt;script&nbsp;type="text/javascript"&nbsp;&gt;
<br /></span><span style="color: #0000BB">\$js</span><span style="color: #DD0000">
<br />
<br />&lt;/script&gt;
<br />
<br /></span><span style="color: #007700">script;
<br />
<br />
<br />

<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">\$script</span><span style="color: #007700">)&nbsp;||&nbsp;isset(</span><span style="color: #0000BB">\$style</span><span style="color: #007700">)&nbsp;||&nbsp;isset(</span><span style="color: #0000BB">\$links</span><span style="color: #007700">)&nbsp;||&nbsp;isset(</span><span style="color: #0000BB">\$metas</span><span style="color: #007700">)&nbsp;||&nbsp;isset(</span><span style="color: #0000BB">\$title</span><span style="color: #007700">))&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$head&nbsp;</span><span style="color: #007700">=&lt;&lt;&lt;&nbsp;head
<br /></span><span style="color: #DD0000">&lt;head&gt;
<br />

<br /></span><span style="color: #0000BB">\$title</span><span style="color: #DD0000">
<br /></span><span style="color: #0000BB">\$metas</span><span style="color: #DD0000">
<br /></span><span style="color: #0000BB">\$links</span><span style="color: #DD0000">
<br /></span><span style="color: #0000BB">\$style</span><span style="color: #DD0000">
<br /></span><span style="color: #0000BB">\$script</span><span style="color: #DD0000">
<br />
<br />&lt;/head&gt;
<br />
<br /></span><span style="color: #007700">head;
<br />

<br />if&nbsp;(isset(</span><span style="color: #0000BB">\$head</span><span style="color: #007700">)&nbsp;||&nbsp;(isset(</span><span style="color: #0000BB">\$body</span><span style="color: #007700">)))&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">\$html&nbsp;</span><span style="color: #007700">=&lt;&lt;&lt;&nbsp;html
<br /></span><span style="color: #0000BB">\$doctype</span><span style="color: #DD0000">
<br />&lt;html&gt;
<br /></span><span style="color: #0000BB">\$head</span><span style="color: #DD0000">
<br />&lt;body&gt;
<br /></span><span style="color: #0000BB">\$body</span><span style="color: #DD0000">
<br />&lt;/body&gt;
<br />&lt;/html&gt;
<br />

<br /></span><span style="color: #007700">html;
<br />if&nbsp;(isset(</span><span style="color: #0000BB">\$html</span><span style="color: #007700">))&nbsp;&nbsp;&nbsp;&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type:&nbsp;text/html;&nbsp;charset=iso-8859-1'</span><span style="color: #007700">);
<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">\$html</span><span style="color: #007700">;
<br />}
<br />
<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code>


mentirijilla;

$title = '<title>Código fuente de "diario.jocker.php"</title>';
$cabeza = '<h1>Código fuente de "diario.jocker.php"</h1>';
$hoy = getdate();
$year = $hoy["year"];

$otros_anuarios = array();
for ($i = 2010; $i <= $year; $i++)
    array_push($otros_anuarios, "<a href='?extra=anuario&amp;a=$i' >$i</a>");
$anuarios = implode(", ", $otros_anuarios);

ob_start();
echo <<< pie
<div id="copyright">
    <h6>
        <span style="font-weight: bolder">Copyright © 2002-$year <a href="index.php">www.pepemolina.com</a></span>
        <br/>
        <a href="diario.rss.xml" >RSS</a>
            <a href="diario.rss.xml" ><img src="diario.imagen.php?id=22&max=10" alt="rss" title="rss" longdesc="diario.ficha.php?id=22" /></a>
        | Ver
        <a href="diario.sitemap.html" >
            Mapa del sitio
        </a>
    </h6>
</div><!-- id="copyright" -->
pie;
$pie = ob_get_clean();

ob_start();
echo <<< cuerpo

$cabeza
<div id='listado'>
$codigo
</div>
<p>
    <b>Listados</b>:
    <a href='?extra=imagenes'>imágenes</a>,
    <a href='?extra=categorias'>categorías</a>,
    <a href='?extra=etiquetas'>etiquetas</a>,
    <a href='?extra=extras'>extras</a> |
    <b>Anuarios</b>:
    $anuarios |
    <b>Otros enlaces</b>: <a href='?extra=buscador'>buscador</a>
</p>
$pie


cuerpo;
$body = ob_get_clean();

ob_start();
echo <<< estilos

body    {
    text-align: left;
    padding: 0;
    margin: 0;
}

h1    {
    text-align: center;
    margin: 0;
    padding: .5em;
    background-color: #eeeeee;
}

#listado    {
    margin: 1em;
    border: 1px solid blue;
    padding: .5em 2em;
}

h6    {
    text-align: center;
    background-color: #eeeeee;
    margin: 0;
    padding: .5em;
}

p    {
    margin: 0 auto;
    text-indent: 3em;
}

estilos;
$css = ob_get_clean();


//$css = "body{text-align: left;}";
$doctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
$metas = "<script type='text/javascript' src='diario.js'></script>";

Este código ha sido leído en 48 ocasiones.

Zona de comentarios

Esta extra aún no tiene comentarios.

Evaluación

Valoración de esta página: (extra.mostrarme) valor

Valoración evaluar evaluar evaluar evaluar evaluar evaluar evaluar evaluar evaluar evaluar

Respuesta: Zona de mensajes (proceso de evaluación)

Listados: imágenes, categorías, etiquetas, extras | Anuarios: 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 | Otros enlaces: buscador