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");
/*
|| Takes the referrer document, only prints the content
|| works only with documents on the same server. good enough :-)
|| V.Satheesh Babu (vsbabu-removethis@vsbabu.org).
||
|| I put an HTML comment called "content_starts_here" before
|| content starts and another one "content_ends_here" after
|| the content. If you have been following some standard like
|| that, it could be useful.
*/
$myroot = "www.vsbabu.org";
if ($HTTP_REFERER)
$myURL = $HTTP_REFERER;
else
$myURL = "http://$myroot/";
// here is the starting comment for your content
$START_CONT = "content_starts_here";
// here is the ending comment for your content
$END_CONT = "content_ends_here";
$parsed_url = parse_url($myURL);
$myServer = $parsed_url['host'];
if ($myServer != $myroot) {
exit(1);
}
$document = $parsed_url['path'];
if($document[strlen($document)-1]=='/') $document = "$document/index.html";
$base_url = dirname($document);
$fp=fsockopen($myServer,80,&$errno,&$errstr,30);
// if you've name based virtual hosting
$request = "GET $document HTTP/1.1\r\n";
$request .= "Host: $myServer\r\n\r\n";
/* if you've normal old type servers,
comment out the previous two lines and
use the next line instead
*/
//$request = "GET $document HTTP/1.0\r\n\r\n";
if(!$fp) {
echo "$errstr ($errno)
\n";
} else {
fputs($fp,$request);
$content=0;
$in_title=0;
?>