delete.php 447 B

12345678910111213141516
  1. <?php
  2. $http_host = $_SERVER['HTTP_HOST'];
  3. include("../../functions.php");
  4. $con = startdb('rw');
  5. if (!checkSession($con)){
  6. header("Location: /index.php");
  7. exit (-1);
  8. }
  9. else{
  10. $id = mysqli_real_escape_string($con, $_GET['p']);
  11. mysqli_query($con, "DELETE FROM post_comment WHERE post = $id;");
  12. mysqli_query($con, "DELETE FROM post_image WHERE post = $id;");
  13. mysqli_query($con, "DELETE FROM post WHERE id = $id;");
  14. version();
  15. }
  16. ?>