Guest User

Untitled

a guest
Apr 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. if ($_SERVER['REQUEST_METHOD'] != 'POST')
  5. {
  6. //display form here
  7. echo "<form name='usrinfo' action='session2.php' method='post'>";
  8. echo "Username: <input type='text' name='usrname'></br></input>";
  9. echo "FakePass: <input type='text' name='fakepass'></br></input>";
  10. echo "<input type='submit' value='Submit!' /></br></form>";
  11.  
  12. session_start();
  13.  
  14.  
  15. $_SESSION['usr'] = $_POST['usrname'];
  16. $_SESSION['pass'] = $_POST['fakepass'];
  17. $_SESSION['time'] = time();
  18. echo "<a href='session2.php'>Page 2 </a>";
  19. }
  20. else
  21. {
  22. session_start();
  23.  
  24. $sessionid = session_id();
  25. echo "Session ID: $sessionid ";
  26. echo "Username: $_SESSION['usr'] </br>";
  27. echo "FakePass: $_SESSION['pass'] </br>";
  28. echo "Time Started: $_SESSION['time'] </br>";
  29. }
  30. ?>
Add Comment
Please, Sign In to add comment