TokyoDisco

Delete files/dir

Dec 16th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. $filename = $_GET['file']; //get the filename
  5.  
  6. if (is_file($filename))
  7. {
  8.  
  9. unlink($filename); //delete it
  10. }
  11. else
  12. {
  13. rmdir($filename);
  14. }
  15.  
  16.  
  17.  
  18. $login = $_SESSION['user'];
  19. $url = "Frame.php?dir=$login";
  20. header("location: $url");
  21.  
  22. //redirect back to the other page
  23.  
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment