I have a script that worked great on an old server that I am migrating my sites from. This is screen scraping script that I use. The old version of PHP 4.1, new version is 4.3+. The script is:
########################################
$url = "http://www.domain.com";
$unique_start = "Starting Text";
$unique_end = "Ending Text";
ini_set('max_execution_time', '0');
flush ();
$fd = fread(fopen("$url", "r"), 100000);
if ($fd)
{
$start= strpos($fd, "$unique_start");
$finish= strpos($fd, "$unique_end");
$length= $finish-$start;
$code=substr($fd, $start, $length);
}
$code = str_replace("Some Text", "New Text", $code);
echo $code;
flush ();
#####################################
Can anyone tell me why this script is just outputting empty pages on the new server? Any help would be greatly appreciated. Thank you.