Advertisement
Guest User

Untitled

a guest
May 15th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. session_start();
  3. if (isset($_POST['username']))
  4. {
  5. if ( $_POST['username'] == 'inte' &&
  6. $_POST['password'] == '2047')
  7. {
  8. $_SESSION['logged_in'] = 'true';
  9. }
  10. else
  11. {
  12. echo '
  13. <i>Incorrect login details.
  14. please try again</i><br />';
  15. }
  16. }
  17. if (! (isset($_SESSION['logged_in']) &&
  18. $_SESSION['logged_in'] == 'true') )
  19. {
  20. echo '
  21. <html>
  22. <head>
  23. <title>Login form</title>
  24. </head>
  25. <body>
  26. <form action="' . $_SERVER['PHP_SELF'] . '"
  27. method="POST">
  28. <div id="logincontainer">
  29. <div id="usernamelogin">
  30. Username: <input type="text"
  31. name="username" />
  32. </div>
  33. <br />
  34. <div id="usernamepassword"/>
  35. Password: <input type="password"
  36. name="password" />
  37. </div>
  38. <br />
  39. <input type="submit" value="Login" />
  40. </div>
  41. </form>
  42.  
  43. </body>
  44. </html>
  45. ';
  46. exit;
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement