PHP Classes
elePHPant
Icontem

File: example/inc/userpage.php

Recommend this page to a friend!
  Classes of Ashraf Gheith  >  PHP Secure Login and Registration  >  example/inc/userpage.php  >  Download  
File: example/inc/userpage.php
Role: Example script
Content type: text/plain
Description: Template
Class: PHP Secure Login and Registration
Register and login users in a database with PDO
Author: By
Last change: Fixed some bugs and security issues
Date: 2 years ago
Size: 1,306 bytes
 

 

Contents

Class file image Download
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap table</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
  <h2>Welcome <?php print $_SESSION['user']['fname'].' '.$_SESSION['user']['lname']; ?></h2>
  <table class="table table-striped">
    <thead>
      <tr>
        <th>Firstname</th>
        <th>Lastname</th>
        <th>Email</th>
      </tr>
    </thead><tbody>
    <?php if($_SESSION['user']['user_role'] == 2){
        foreach (
$vars as $user) {
       
?>
<tr>
                <td><?=$user['fname']?></td>
                <td><?=$user['lname']?></td>
                <td><?=$user['email']?></td>
            </tr>
        <?php
       
}
    }else{
?>
<tr>
        <td><?=$_SESSION['user']['fname']?></td>
        <td><?=$_SESSION['user']['lname']?></td>
        <td><?=$_SESSION['user']['email']?></td>
      </tr>
    <?php } ?></tbody>
  </table>
  <p><a href='logout.php'>Logout</a></p>
</div>

</body>
</html>