Guest User

Untitled

a guest
May 26th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.24 KB | None | 0 0
  1.     <?php
  2.     error_reporting(-1);
  3.     session_start();
  4.     include 'includes/mysqli_connect.php';
  5.     include 'includes/functions.php';
  6.      
  7.     ?>
  8.     <?php include 'includes/template/header.php'; ?>
  9.     <center>
  10.     <div id="wrap">
  11.     <br>
  12.     <?php include 'includes/template/navbar.php'; ?>
  13.     <div class="wrapbg">
  14.     <span class="corners-top"><span></span></span>
  15.     <div id="content">
  16.     <?php
  17.     //Defines id to get_id
  18.     $id = mysqli_real_escape_string($link, $_GET['id']);
  19.     //does sql querying based on the id
  20.     $sql = "SELECT * from users where id = '$id'";
  21.     $result = mysqli_query($link, $sql);
  22.     ?>
  23.     <table>
  24.     <?php
  25.     //echoes error if profile does not exist
  26.     if(mysqli_num_rows($result) == 0){ echo "The profile you are looking for does not exist."; }
  27.     //if exists does a while loop to echo the shizz out
  28.     while($row = mysqli_fetch_assoc($result)){
  29.     $username = $row['username'];
  30.     $about_me = $row['about_me'];
  31.     $picture = $row['picture'];
  32.     echo "About " . $username;
  33.     ?>
  34.     <hr class='hr1'>
  35.     <?php echo $row['about_me'];
  36.     echo "<img src='$picture'></img>"; ?>
  37.     <hr class='hr1'>
  38.     <?php
  39.     if($row['status'] == 0){ "$username is <font color='red'>offline</font>"; } else {  echo "$username is <font color='green'>online</font>";  } ?>
  40.     </table>
  41.     </div>
  42.     <span class="corners-bottom"><span></span></span>
  43.     </div>
  44.      
  45.     <div class="wrapbg">
  46.     <span class="corners-top"><span></span></span>
  47.     <div id="content">
  48.     Forum posts by <?php echo $row['username'] ?>
  49.     <?php
  50.     //Querying to show forum posts by the user
  51.      
  52.     $forum = "SELECT * from topics where starter = '$username'";
  53.     $run = mysqli_query($link, $forum) or die(mysqli_error($link));
  54.     //Doing a while loop to echo out the forum posts
  55.     while($row1 = mysqli_fetch_assoc($run)){
  56.     $topicid = $row1['id'];
  57.     $catid = $row1['cat_id'];
  58.     ?>
  59.     <br><a href='forum_topic.php?cat_id=<?php echo $row1['cat_id'] ?>&topic_id=<?php echo $row1['id'] ?>'><h1><?php echo $row1['title'] ?></h1></a><hr class='hr1'> <?php
  60.     } } ?>
  61.     </div>
  62.     <span class="corners-bottom"><span></span></span>
  63.     </div>
  64.     <br />
  65.     <?php include 'includes/template/footer.php'; ?>
Add Comment
Please, Sign In to add comment