Hi all:
Getting a "Warning" when trying to unlink:
Here is the code:
if ($handle = opendir("/home/everycar/public_html/deq/")) {
while (false !== ($file = readdir($handle))) {
$filelastmodified = filemtime($file);
//if((time()-$filelastmodified) > 10*24*3600)
if((time()-$filelastmodified) > 10)//for testing
{
echo $file;
unlink($file);//line 23
}
}
closedir($handle);
}
And here is the warning:
Warning: unlink(..) [function.unlink]: Is a directory in /home/everycar/public_html/deq/deqCreateFile.php on line 23
deqCreateFile.php is the file that the code is written on so there is no directory in deqCreateFile.php. But I don't get how to fix this.
Thanks!