I get errors when I run that script! Thanks for the reply though, and it does point me in the right direction, looking for </body> via string matching. I'm trying this code out to see if it works...
extract($HTTP_POST_VARS);
$fpoint = fopen('http://www.domain.com/link_list.html', "r+");
$body = "</body>";
$fileinfo = "";
while (!feof($fpoint))
{
$line = fgets($fpoint);
if(!(strpos($line, $body) === false))
{
$offset = strpos($line, $body);
fseek($fpoint, $offset);
$addurl = "<a href='http://www.domain.com".$article_URL."'>".$headline."</a>\n";
$fileinfo .= $addurl;
}
}
fwrite($fpoint, $fileinfo);
fclose($fpoint);
But I keep getting the same error that I got with your script:
not valid file handle resource.
and
wrong parameter count for fgets()
these errors appear both in Sam's code and my code. I changed the file fopen() calls to a relative domain as well (to avoid the http thing) and still no luck. Any ideas?