help pls i dont know what wrong but this dont delete file on the server 🙁
$dir = "/home/users/";
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && preg_match ("/.DAT/", $file)) {
$filesys = eregi_replace("/","\\",$file);
$delete = @system("rm -Rf $dir.$filesys");
if (@file_exists($dir.$file)) {
$delete = @chmod ($dir.$file, 0775);
$delete = @unlink($dir.$file);
$delete = @system("del $dir.$filesys"); //dnot know if i have to use rm command for linux server?
}
}
}
}
closedir($handle);
thi display all the display but i dont get why i cant erase each file.. pls help about this i cant figure it out anymore.