Advertisement
Guest User

Untitled

a guest
Jun 30th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 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. $arrUsers = array (0 => "gorgor", 1 => "dwt", 2 => "bedlamsticks");
  20. $arrPassword = array (0 => "tyrantlizard", 1 => "slowmentaltorture", 2 => "carnivore");
  21.  
  22.  
  23. if (isset($_POST["submit"])){
  24.  
  25. $strUser = $_POST["strUser"];
  26. $strPassword = $_POST["strPassword"];
  27.  
  28. if (in_array($strUser, $arrUsers)) {
  29. $intKey = key($arrUsers);
  30.  
  31. if (in_array($strPassword, $arrPassword[$intKey])) {
  32. echo "Username and Password match!";
  33. }
  34. else
  35. echo "Incorrect Password.";
  36.  
  37. }
  38.  
  39. else
  40. echo "No such Username found.";
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. //echo "<p> $strNewPasswordEncrypted</p>";
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56. }
  57.  
  58.  
  59.  
  60. ?>
  61.  
  62.  
  63.  
  64. </body>
  65.  
  66.  
  67.  
  68. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement