I set up a thing so that, from various places on my website, I can link to a page called "linktothis.php" which will include a link to the referring page. It works fine in firefox, but IE seems to give it trouble and it tells me:
Warning: fread(): supplied argument is not a valid stream resource in /usr/local/apache/sites/nextadvisor/linktothis.php on line 19
(line 19 is the 4th line below)
<?php
$filesource = $_SERVER['HTTP_REFERER'];
$a = fopen($filesource,"r"); //fopen("html_file.html","r");
$string = fread($a,1024);
if (eregi("<linkto>(.*)</linkto>",
$string, $out)) {
$outdata = $out[1];
}
//echo $outdata;
$outdatapart = explode( " " , $outdata);
echo $part[0];
if (empty($outdata)) if (eregi("<title>(.*)</title>",
$string, $out)) {
$outdata = $out[1];
}
//echo $outdata;
$outdatapart = explode( " " , $outdata);
echo $part[0];
?>
What do I need to switch so that this will work in IE?