Bah, I posted the wrong code 🙂
As for now I'll I want to do is delete all the files inside the home2 directory, this is the code so far:
<?php
if ($handle = opendir('../home2/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file\n";
chmod($file,0777);
unlink("$file");
echo "File Deleted";
}
}
closedir($handle);
}
?>
Which gives these errors:
files.php
Warning: Unable to access files.php in /home/home1/files2.php on line 6
Warning: chmod failed: No such file or directory in /home/home1/files2.php on line 6
Warning: unlink() failed (No such file or directory) in /home/home1/files2.php on line 7
File Deleted
So it finds the files, but can't chmod or unlink.
Any ideas??
ghjr