Link tag.
* Examples:
* php: Print this page
* html Print another page
*
** To leave images intact change line 36 to $stripImages = "no";
*
** This page must be in the root directory.
*
** Place at the beginning of the content you
* would like to print and at the end.
*
** That's all there is to it.
*************************************************************************/
// Begin: Functions used.
function i_denude(&$variable){
//STRIP ALL TAGS THAT START WITH ]* *>", "", $variable);
}
function i_denudef(&$variable){
$tmpText = preg_replace("/(< *font[^>]* *>)(.*)((< */ *font[^>]* *>))/i","$2", $variable);
return $tmpText;
}
// End functions used.
// Set Variables
$url = $_REQUEST['url'];
$url = ereg_replace("^/?", "", $url); //strip slashes for security
$stripImages = "yes";
$startingpoint = "";
$endingpoint = "";
$referer = $_SERVER['HTTP_REFERER'];
// Open and read file specified in URL.
$file = $url; // $chage $url to $_SERVER['HTTP_REFERER'];
// to use as older version.
$str_value = "";
$read = fopen($file, "rb");
while(!feof($read)){
$str_value .= fread($read, filesize($file));
}
fclose($read);
// Get length of print text
$str_start = strpos($str_value, "$startingpoint");
$str_finish = strpos($str_value, "$endingpoint");
$str_length = $str_finish-$str_start;
$str_value = substr($str_value, $str_start, $str_length);
// Got length of string between $startingpoint and $endpoint
// and send to other $variable. Easy to debug for later revision
$PHPrint = $str_value;
// Strip HTML font tag and/or HTML img tags.
if ($stripImages == "yes") {
$PHPrint = i_denude($PHPrint);
}
$PHPrint = i_denudef($PHPrint);
$PHPrint = stripslashes($PHPrint);
?>
Print this Page
")){
eval('?>'.$line);
}
else{
if (strstr($line,"")){
$mode = 1;
}
elseif (strstr($line,"?>")){
$mode = 0;
}
elseif ($mode){
if(strstr($line,";")){
eval($line);
}
}
else {
echo $line;
}
}
}
echo "This page was printed from: $referer";
flush ();
?>