Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(-1);
- session_start();
- include 'includes/mysqli_connect.php';
- include 'includes/functions.php';
- ?>
- <?php include 'includes/template/header.php'; ?>
- <center>
- <div id="wrap">
- <br>
- <?php include 'includes/template/navbar.php'; ?>
- <div class="wrapbg">
- <span class="corners-top"><span></span></span>
- <div id="content">
- <?php
- //Defines id to get_id
- $id = mysqli_real_escape_string($link, $_GET['id']);
- //does sql querying based on the id
- $sql = "SELECT * from users where id = '$id'";
- $result = mysqli_query($link, $sql);
- ?>
- <table>
- <?php
- //echoes error if profile does not exist
- if(mysqli_num_rows($result) == 0){ echo "The profile you are looking for does not exist."; }
- //if exists does a while loop to echo the shizz out
- while($row = mysqli_fetch_assoc($result)){
- $username = $row['username'];
- $about_me = $row['about_me'];
- $picture = $row['picture'];
- echo "About " . $username;
- ?>
- <hr class='hr1'>
- <?php echo $row['about_me'];
- echo "<img src='$picture'></img>"; ?>
- <hr class='hr1'>
- <?php
- if($row['status'] == 0){ "$username is <font color='red'>offline</font>"; } else { echo "$username is <font color='green'>online</font>"; } ?>
- </table>
- </div>
- <span class="corners-bottom"><span></span></span>
- </div>
- <div class="wrapbg">
- <span class="corners-top"><span></span></span>
- <div id="content">
- Forum posts by <?php echo $row['username'] ?>
- <?php
- //Querying to show forum posts by the user
- $forum = "SELECT * from topics where starter = '$username'";
- $run = mysqli_query($link, $forum) or die(mysqli_error($link));
- //Doing a while loop to echo out the forum posts
- while($row1 = mysqli_fetch_assoc($run)){
- $topicid = $row1['id'];
- $catid = $row1['cat_id'];
- ?>
- <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
- } } ?>
- </div>
- <span class="corners-bottom"><span></span></span>
- </div>
- <br />
- <?php include 'includes/template/footer.php'; ?>
Add Comment
Please, Sign In to add comment