here is another that i have been trying to use. i am having trouble though, because it doesn't print the header information. e.g. the head, title, style...
advice would be greatly appreciated.
<?
/
|| Takes the referrer document, only prints the content
|| works only with documents on the same server. good enough :-)
|| V.Satheesh Babu (vsbabu@csoft.net).
||
|| 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.
/
$document=ereg_replace("http://$SERVER_NAME/","",$HTTP_REFERER);
$fp=fsockopen($SERVER_NAME,$SERVER_PORT,&$errno,&$errstr,30);
if(!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($fp,"GET /$document HTTP/1.0\n\n");
$content=0;
while(!feof($fp)) {
$line=fgets($fp,4096);
if(ereg("<title>",$line)){
?>
<HEAD>
<? echo "$line"; ?>
<BASE HREF="<? echo "$HTTP_REFERER"; ?>">
<STYLE TYPE="TEXT/CSS">
<!--
body,p,pre {
background: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10pt;
margin-left: 5px;
margin-top: 5px;
margin-right: 5px;
margin-bottom: 5px;
color: #000000;
text-align: justify;
}
TH.headerrow {
background-color: #CDC8B1;
font-family: verdana,courier;
font-size: 10pt;
color: black;
}
TD.datarow {
font-family: verdana,courier;
font-size: 10pt;
color: black;
}
//-->
</STYLE>
</HEAD>
<BODY>
<?
}
if(ereg("content_starts_here",$line)) $content=1;
if(ereg("content_ends_here",$line)) $content=0;
if($content==1)echo $line;
}
fclose($fp);
?>
<HR>
<CENTER>
<SMALL>Script Copyright © <U>V.Satheesh
Babu</U>. All rights reserved.</SMALL><BR>
<?echo "<SMALL><I>Source: <A HREF=\"$HTTP_REFERER\">$HTTP_REFERER</A></I></SMALL>\n";?>
</CENTER>
</BODY>
<?
}
?>