Version imprimible

Hola a todos. Necesito saber como hacer la versión amigable o imprimible de una página php cuyo contenido son reportes. ¿Es esto posible? ¿Cómo hacerlo?
Gracias

1 respuesta

Respuesta
1
Donde quieras que se comience a coger el texto pones este tag <!-- Startprint --> y donde quieres que termine pon este <! -- stopprint -->.
$startingpoint = "<!-- startprint -->";
$endingpoint = "<!-- stopprint -->";
error_reporting(0);
$read = fopen($HTTP_REFERER, "r") or die("<br /><font face=\"Verdana\">No puedo acceder al fichero </font><br><br>")";
error_reporting(1);
$value = "";
while(!feof($read)){
$value .= fread($read, 10000); number to save server load
}
fclose($read);
$start= strpos($value, "$startingpoint");
$finish= strpos($value, "$endingpoint");
$length= $finish-$start;
$value=substr($value, $start, $length);
function i_denude($variable) {
return(eregi_replace("<img src=[^>]*>", "", $variable));
}
function i_denudef($variable) {
return(eregi_replace("<font[^>]*>", "", $variable));
}
$PHPrint = ("$value");
if ($stripImages == "yes") {
$PHPrint = i_denude("$PHPrint");
}
$PHPrint = i_denudef("$PHPrint");
$PHPrint = str_replace( "</font>", "", $PHPrint );
$PHPrint = stripslashes("$PHPrint");
echo "<base href=\"$baseURL\">";
echo $PHPrint;
echo "<br/><br/>Tomado de: $HTTP_REFERER";
flush ();

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas