Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. //From the index page//
  2. <!-- Log out commands -->
  3. <?php
  4. if (isset($_POST["logoffuser"])){
  5. set_Logout();
  6. $_POST = array();
  7. include_once("index.php");
  8. }
  9. ?>
  10.  
  11. <form class='navbar-form navbar-right' method='POST'>
  12. <div class="form-group">
  13. <div class='alert alert-success'>
  14. Logged in as <?php echo $_SESSION['fullname']; ?>! <?php echo $_SESSION['lastTimeLoggedIn'];?>
  15. <input type='submit' name='logoffuser' value='Log Off' class='btn btn-primary' />
  16. </div>
  17. </div>
  18. </form>
  19.  
  20. <form class="navbar-form navbar-right" method="post">
  21. <?php if (isset($_POST["logIn"])){
  22. if (!empty($login_out_message)){
  23. echo "<p class='alert alert-danger'> $login_out_message </p>";
  24. $_POST = array();
  25. }else{
  26. set_Login();
  27.  
  28. }
  29. }else{
  30.  
  31. }?>
  32. <div class="form-group">
  33. <label for="">Username:</label>
  34. <input type="text" name="Username" value="" class="form-control">
  35. </div>
  36. <div class="form-group">
  37. <label for="Password">Password:</label>
  38. <input type="password" name="Password" value="" class="form-control">
  39. </div>
  40. <button type="submit" name="logIn" class="btn btn-primary">Login</button>
  41. <button type="submit" name="Register" class="btn btn-primary">Register</button>
  42. </form>
  43.  
  44. <?php
  45. //dubug purposes
  46. // var_dump($_SESSION);
  47. //
  48. if (isset($_SESSION) && sizeof($_SESSION) > 0) {
  49. include("partial/_loggedin.php");
  50. } elseif (sizeof($_SESSION) == 0) {
  51. include("partial/_loggedout.php");
  52. }
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement