Hi, i´m trying to make a php script that retreives a full webpage, i wanted to use this script but i can´t get it to work :S Every time i get the part "website down." I doný know what the prob is...
But there is more.. 🙂 ... I also want the script to change some words in the text, change the bgcolor, and some images of the remote hosted site. I only can come up with this... but i think i´m using the wrong coding for the prob..
Can you please help?
<?
if(!($myFile=fopen("http://www.website.com","r")))
{
echo "website down.";
exit;
}
while(!feof($myFile))
{
$myLine.=fgets($myFile,255);
}
fclose($myFile);
$start="<html>";
$end="<!/html>";
$start_position=strpos($myLine, $start);
$end_position=strpos($myLine, $end)+strlen($end);
$length=$end_position-$start_position;
$myLine=substr($myLine, $start_position, $length);
echo $myLine;
?>