Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require"db_connect.php";
- //get the page id
- if(isset($_GET['id']) && is_numeric($_GET['id'] ))
- {
- $id = $_GET['id'] ;
- } else { die("Error!"); }
- //Check to see if the id is a valid id
- $idCheck = mysqli_query($db, "SELECT * FROM forum_tabl WHERE forum_id='".$id."'");
- $checky= mysqli_num_rows($idCheck);
- if ($checky != 1) {
- die("error");
- }
- $row = $idCheck->fetch_object();
- $sql = "SELECT post_id, post_title FROM forum_post WHERE forum_id='$id' AND type='o'";
- if($query = $db->prepare($sql)){
- $query->bind_param('s', $id);
- $query->bind_result($post_id, $post_title);
- $query->execute();
- $query->store_result();
- }else{
- echo $db->error;
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="style.css" />
- <title><?php- $row->forum_name?>!</title>
- <html>
- <head>
- <body>
- <div id="page">
- <center><h1>Welcome to Our forms.</h1></center>
- <h2>Our minecraft forum is displayed below</h2>
- <table width="100%">
- <?php $query = new test();?>
- <?php if(test->num_rows!=0):?>
- <?php while($query-fetch()):?>
- <tr>
- <td><?- $post_title?></td
- </tr>
- <?php endwhile;?>
- <?php else:?>
- <tr>
- <td><p>No Posts yet!</p></td>
- </tr>
- <?php endif;?>
- </table>
- </html>
- </head>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement