Advertisement
Guest User

Untitled

a guest
Jun 30th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <html>
  2. <head></head>
  3. <body>
  4. <h4>Please Enter Your Username and Password:</h4>
  5. <form action='<?php echo $_SERVER["PHP_SELF"] ?>' method='post'>
  6. <p>
  7. <label for="strPassword">Username: </label>
  8. <input type='text' name='strUser' id='strUser'/></p>
  9.  
  10. <form action='<?php echo $_SERVER["PHP_SELF"] ?>' method='post'>
  11. <p>
  12. <label for="strPassword">Password: </label>
  13. <input type='text' name='strPassword' id='strPassword'/></p>
  14. <p><input type='submit' name='submit'/></p>
  15. </form>
  16.  
  17. <?php
  18.  
  19. $arrUserPassword = array ("gorgor" => "tyrantlizard", "dwt" => "slowmentaltorture", "bedlamsticks" => "carnivore");
  20.  
  21.  
  22. if (isset($_POST["submit"])){
  23.  
  24. $strUser = $_POST["strUser"];
  25. $strPassword = $_POST["strPassword"];
  26.  
  27. if (in_array($strUser, $arrUserPassword)) {
  28. $strAcceptedPassword = $arrUserPassword[$strUser];
  29.  
  30. if $strPassword == $strAcceptedPassword {
  31. echo "Username and Password match!";
  32. }
  33. else
  34. echo "Incorrect Password.";
  35.  
  36. }
  37.  
  38. else
  39. echo "No such Username found.";
  40. }
  41.  
  42.  
  43. ?>
  44.  
  45. </body>
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement