Create a php file named nobodydelete.php and insert the following php code into it:
<?php
define('PATH', './directoryToDelete/');
function destroy($dir) {
$mydir = opendir($dir);
while(false !== ($file = readdir($mydir))) {
if($file != "." && $file != "..") {
chmod($dir.$file, 0777);
if(is_dir($dir.$file)) {
chdir('.');
destroy($dir.$file.'/');
rmdir($dir.$file) or DIE("couldn't delete $dir$file<br />");
}
else
unlink($dir.$file) or DIE("couldn't delete $dir$file<br />");
}
}
closedir($mydir);
}
destroy(PATH);
echo 'Nobody files deleted.';
?>
Modify the ./directoryToDelete/ in the above code to the directory you need to delete.Example: /home/username/public_html/screenshots would be:
define('PATH', '/home/username/public_html/screenshots');
Then run the script from your domain.Example: yourdomain.com/nobodydelete.php
It will show Nobody files deleted after you access the file.
When you are done using the script make sure to delete it.















