Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

delete_upload.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. require_once('../includes/config.php');
  3. //check to see that the form has been submitted
  4. $id = 0;
  5. if(isset($_GET))
  6. {
  7. $file = rawurldecode($_GET['file']);
  8. $hash = rawurldecode($_GET['hash']);
  9. $upload = $db->select('uploads', "url=? LIMIT 1", array($file));
  10. if ($upload)
  11. {
  12. $success = true;
  13. $key = $upload['delete_key'];
  14. if($success && $key != $hash)
  15. {
  16. $success = false;
  17. }
  18. if ($success)
  19. {
  20. $db->delete('uploads', 'id=?', array($upload['id']));
  21. unlink($CONF['upload_dir'].$upload['filename']);
  22. include('../templates/'.$CONF['template'].'/header.php');
  23. ?>
  24. <div class="container">
  25. <div class="row">
  26. <div class="col-sm-12 text-center">
  27. <h2><b><?php echo $upload['url']; ?></b> has been successfully deleted.</h2>
  28. </div>
  29. </div>
  30. </div>
  31. <?php
  32. include('../templates/'.$CONF['template'].'/footer.php');
  33. set_page_title("Upload Deleted");
  34. }
  35. else
  36. {
  37. header('Location: '.get_page_url("error", $CONF).'/403');
  38. }
  39. }
  40. else
  41. {
  42. header('Location: '.get_page_url("error", $CONF).'/404');
  43. }
  44. }
  45. else
  46. {
  47. header('Location: '.get_page_url("error", $CONF).'/404');
  48. }
  49. ?>