Advertisement
Guest User

Untitled

a guest
Jul 16th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php
  2. include_once 'header.php';
  3. ?>
  4. <?php
  5. $id = @$_GET["id"];
  6. $role = $_SESSION['u_member'];
  7. $delete = mysqli_query($conn, "SELECT * FROM topics WHERE topic_id='".$id."'");
  8. $row = mysqli_fetch_assoc($delete);
  9. ?>
  10. <div class="main-wrapper">
  11. <br/>
  12. <br/>
  13. <h1>Submit a Request</h2>
  14. <hr/>
  15. <form method="POST" action="delete.php?id=<?php echo $id; ?>">
  16.  
  17. <center/>Are you sure you want to delete it?<br/><input class ="slidebutton" type="submit" name="submit" value="Post">
  18.  
  19. <br/>
  20. <?php
  21. if (isset($_POST['submit'])) {
  22. if($role == 'Premier'){
  23. mysqli_query($conn, "DELETE from topics WHERE topic_id='$id'");
  24. echo "<center/>POST deleted. Back to <a href='forum.php'>Forum</a>";
  25. }
  26. elseif ($role == 'Basic') {
  27. echo "<center/>You don't have rights. Back to <a href='forum.php'>Forum</a>";
  28. }
  29. }
  30. ?>
  31. </form>
  32. </div>
  33.  
  34. <?php
  35. include_Once 'footer.php';
  36. ?>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement