Advertisement
Guest User

Untitled

a guest
Jul 4th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title></title>
  6. </head>
  7. <body>
  8. <?php
  9.  
  10. Session_start();
  11.  
  12. $passwords = array("nate" => "letmein",
  13. "alaxic" => "thisisme");
  14.  
  15. if (!$_POST["username"] or !$_POST["password"]) {
  16. echo "You must enter your username and password";
  17. exit;
  18. }
  19. if ($_POST["password"] == $passwords[$_POST["username"]]) {
  20. echo "Login successful!";
  21. $_SESSION["auth_username"] = $_POST["username"];
  22. }
  23. else {
  24. echo "Login incorrect. Please try again.";
  25. }
  26. ?>
  27. <FORM ACTION="login.php" METHOD="POST">
  28. <TABLE BORDER=0>
  29. <TR>
  30. <TD>Username:</TD>
  31. <TD><INPUT TYPE="TEXT" SIZE=10 NAME="username"></TD>
  32. </TR>
  33. <TR>
  34. <TD>Password:</TD>
  35. <TD><INPUT TYPE="PASSWORD" SIZE=10 NAME="password"></TD>
  36. </TR>
  37. </TABLE>
  38. <INPUT TYPE=SUBMIT VALUE="Log in">
  39. </FORM>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement