Advertisement
Guest User

e

a guest
Aug 29th, 2015
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require"db_connect.php";
  4. //get the page id
  5. if(isset($_GET['id']) && is_numeric($_GET['id'] ))
  6. {
  7. $id = $_GET['id'] ;
  8. } else { die("Error!"); }
  9. //Check to see if the id is a valid id  
  10. $idCheck = mysqli_query($db, "SELECT * FROM forum_tabl WHERE forum_id='".$id."'");
  11. $checky= mysqli_num_rows($idCheck);  
  12. if ($checky != 1) {  
  13. die("error");  
  14. }  
  15. $row = $idCheck->fetch_object();
  16. $sql = "SELECT post_id, post_title FROM forum_post WHERE forum_id='$id' AND type='o'";
  17. if($query = $db->prepare($sql)){
  18.     $query->bind_param('s', $id);
  19.     $query->bind_result($post_id, $post_title);
  20.     $query->execute();
  21.     $query->store_result();
  22. }else{
  23.     echo $db->error;
  24. }
  25.  
  26. ?>
  27.  
  28. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  29. <html xmlns="http://www.w3.org/1999/xhtml">
  30. <head>
  31. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  32. <link rel="stylesheet" type="text/css" href="style.css" />
  33. <title><?php- $row->forum_name?>!</title>
  34. <html>
  35. <head>
  36. <body>
  37. <div id="page">
  38. <center><h1>Welcome to Our forms.</h1></center>
  39. <h2>Our minecraft forum is displayed below</h2>
  40. <table width="100%">
  41. <?php $query = new test();?>
  42. <?php if(test->num_rows!=0):?>
  43. <?php while($query-fetch()):?>
  44. <tr>
  45. <td><?- $post_title?></td
  46. </tr>
  47.  
  48.  
  49. <?php endwhile;?>
  50. <?php else:?>
  51. <tr>
  52. <td><p>No Posts yet!</p></td>
  53. </tr>
  54. <?php endif;?>
  55. </table>
  56.  
  57. </html>
  58. </head>
  59. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement