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_podcast.php 885B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. require_once('../includes/config.php');
  3. //check to see that the form has been submitted
  4. $id = 0;
  5. if(isset($_POST) && $logged_in)
  6. {
  7. $id = rawurldecode($_POST['id']);
  8. $post = $db->select('podcast', "id=? LIMIT 1", array($id));
  9. if ($post)
  10. {
  11. $success = true;
  12. $filename = $post['file_name'];
  13. if($success && !$user->admin)
  14. {
  15. $error = "You are not allowed to delete this podcast.";
  16. $success = false;
  17. }
  18. if ($success)
  19. {
  20. if (file_exists($CONF['podcast_dir'].$filename))
  21. {
  22. unlink($CONF['podcast_dir'].$filename);
  23. }
  24. $db->delete('podcast', 'id=?', array($id));
  25. echo "true";
  26. }
  27. else
  28. {
  29. echo $error;
  30. }
  31. }
  32. else
  33. {
  34. echo "That podcast post does not exist.";
  35. }
  36. }
  37. else
  38. {
  39. echo "You need to be logged in to delete this podcast.";
  40. }
  41. ?>