Hi All:
I've reviewed the manual, and various books multiple times, but unfortunately I'm still getting an error "supplied argument is not a valid file-handling resource". So I'm hoping someone can look at my code in point me in the right direction.
The goal is to take a syndicate feed (that is only provided via http://), and write it to file for ongoing use. I'll worry about setting seek times, after I can actually get the feed written to file. My code is...
<?
$cache = "/alnisa/macTracker.txt";
$backend = "http://www.versiontracker.com/cgi-bin/syndicate.pl?USER=temp&PLATFORM=mac&TYPE=hot&FORM=htmlfrag";
$fpread = fopen($backend, "r");
if ($fpread =="") {
echo("Did Not Open TechTracker Data Feed");
}
else {
$file = (fgets($fpread, 5000));
if($file = $fpread); {
fwrite($cache, $file);
}
}
@fclose($backend);
?>
The error is always at the fwrite line. But the format seems correct. My only guess is that the issue lies with writing to a different file than was read from, but I can't figure out how to get around that or how to test if that's the actually cause of the error.
Any help would be greatly appreciated.