I am in the process of producing a script which will allow me to produce
printer-friendly versions of my dynamically produced web pages.

For the most part it is working but take a look here...

www.ski-info-online.com/skiResort-print1.php?id=Alpbach

If you click the "Print Review" button it all seems to work fine, except
1) it's slow and...
2) do you see those numbers c3 fd6 and 52 59c (may take a few seconds)?

Where on Earth did they come from?  They are not in the html (as you would
also see them on the main review page). They also appear to be the cause of
the
script running slow.

Here is my php code.

PHP:------------------------------------------------------------------------
--------

<?
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modifieed: ". gmdate("D, d M Y H:i:s"). " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Cache-Control: post-check=0,pre-check=0");
header("Cache-Control: max-age=0");
header("Pragma: no-cache");

if ($HTTP_REFERER){
    $myURL = $HTTP_REFERER;
} else {
    $myURL = "http://www.ski-info-online.com/";;
}

$START_CONT="<!-- CONTENT STARTS -->";
$END_CONT = "<!-- CONTENT ENDS -->";

$parsed_url = parse_url($myURL);
$myServer = $parsed_url['host'];
$document = $parsed_url['path'];
$query = $parsed_url['query'];

if($document[strlen($document)-1]=='/'){
    $document = "$document/index.php";
    $base_url = dirname($document);
}

$fp=fsockopen($myServer,80,&$errno,&$errstr,30);

$request = "GET $document"."?"."$query"." HTTP/1.1\r\n";
$request .= "Host: $myServer\r\n\r\n";

if(!$fp) {
  echo "$errstr ($errno)<br>\n";
} else {
  fputs($fp,$request);
  $content=0;
  $in_title=0;
?>
<HTML>
<HEAD>
<BASE HREF="<? echo "http://$myServer$base_url/";; ?>">
<link rel="stylesheet" href="printable.css">

<?
  while(!feof($fp)) {
    $line=fgets($fp,4096);

    if(ereg($START_CONT,$line)) {
        $content=1;
    }
    if(ereg($END_CONT,$line)) $content=0;
    if($content==1)echo $line;
}
fclose($fp);
?>

<HR>
<CENTER>
<SMALL>Copyright &copy; <U>Ski-Info-Online.com</U>. All rights
reserved.</SMALL><BR>
<?echo "<A HREF=\"$myURL\"><SMALL><I>$myURL</I></SMALL></A>\n";?>
</CENTER>
</BODY>
</HTML>

<?
}
?>

----------------------------------------------------------------------------
----


Any help greatly appreciated.

Torrent


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to