I have the following code in include the content on my website, but I'm having a little trouble with it. The script isn't mine, it came from: www.cyberfly.net so all kudos to him for this work.
function rdfshow($rdffile) {
$filename = CACHEPATH . md5($rdffile);
//$filename = CACHEPATH . $rdffile;
echo $filename . '<br>';
if(!file_exists($filename)) {
$fp = fopen($filename, "w");
if (!($fp == '')) {
fputs($fp, join('', file($rdffile)));
fclose($fp);
}
} else {
echo 'no, this is true';
exit();
if((time() - filemtime($filename)) > CACHETIME) {
$fp = fopen($filename, "w");
if (!($fp == '')) {
fputs($fp, join('', file($rdffile)));
fclose($fp);
}
}
}
where $rdffile = a url to an existing (tested) rdf. The error that I get is:
Warning: fopen("cache/bca9646b3da7363b1a883e0eccc0e3b9", "w") - No such file or directory in /var/www/html/newsFeeds/include.rdfshow.php on line 29
line 29 is:
$fp = fopen($filename, "w");
the directory "cache" is set chmod 777 on my site and I've tested another script to write files to this directory without any problems, but for some reason, this one doesn't want to work.
Any help would be appreciated.