Guest User

Untitled

a guest
Dec 18th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <?php
  2. include('functions.php');
  3.  
  4. if (!isLoggedIn()) {
  5. $_SESSION['msg'] = "You must log in first";
  6. header('location: login.php');
  7. }
  8.  
  9. require_once 'dbcon.php';
  10.  
  11. ?>
  12.  
  13.  
  14. <?php
  15. $stmt = $DB_con->prepare('SELECT id, username, description, userprofile FROM users ORDER BY id DESC');
  16. $stmt->execute();
  17. if($stmt->rowCount() > 0)
  18. {
  19. $row=$stmt->fetch(PDO::FETCH_ASSOC);
  20.  
  21. extract($row);
  22. }
  23. ?>
  24.  
  25. <!DOCTYPE html>
  26.  
  27. <html>
  28. <head>
  29. <title> Home</title>
  30. </head>
  31. <body>
  32.  
  33.  
  34.  
  35.  
  36.  
  37. <!-- logged in user information -->
  38. <div class="profile_info">
  39. <img src="uploads/<?php echo $row['userprofile']; ?>" class="img-rounded" width="250px" height="250px" />
  40. <div>
  41. <?php if (isset($_SESSION['user'])) : ?>
  42. <strong><?php echo $_SESSION['user']['username']; ?></strong>
  43.  
  44. <small>
  45. <i style="color: #888;">(<?php echo ucfirst($_SESSION['user']['user_type']); ?>)</i>
  46. <br>
  47. <a href="home.php?logout='1'" style="color: red;">logout</a>
  48.  
  49. </small>
  50. <h4> Status: <?php echo $description ?> </h4>
  51.  
  52. <?php endif ?>
  53. </div>
  54. </div>
  55.  
  56. </div>
  57.  
  58. </div>
  59. </div>
  60. </body>
  61. </html>
Add Comment
Please, Sign In to add comment