noordean

section.php

Sep 29th, 2016
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require_once('class.php');
  4. $user = new User();
  5. if (!$user->isLoggedIn()) {
  6.     header("Location:login_html.php");
  7. }
  8. echo "Welcome ".$_SESSION['user']."<br>";
  9. echo "<a href='redirect.php'>Logout</a> <br>";
  10. echo "<strong>".$_GET['section']." Section". "</strong><br>";
  11. echo "<a href=".'post_html.php?section='.$_GET['section'].">Create Topic</a> <br>";
  12. $sectionid = $user->getSectionId($_GET['section']);
  13. $topics = $user->getTopics($sectionid);
  14. if(mysqli_num_rows($topics) > 0){
  15.     while($row=mysqli_fetch_assoc($topics)){
  16.         extract($row);
  17.         $time = date('d-m-Y \a\t h:iA',"$time_submitted");
  18.         echo "<hr> <br>";      
  19.         echo "<strong><a href='thread.php?refid=$topicid'>$topic </a></strong><br>";
  20.         echo "By $poster on $time <br>";
  21.         echo "<hr>";
  22.     }
  23. }
  24. else{
  25.     echo "No topics created yet";
  26. }
Add Comment
Please, Sign In to add comment