Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head></head>
- <body>
- <h4>Please Enter Your Username and Password:</h4>
- <form action='<?php echo $_SERVER["PHP_SELF"] ?>' method='post'>
- <p>
- <label for="strPassword">Username: </label>
- <input type='text' name='strUser' id='strUser'/></p>
- <form action='<?php echo $_SERVER["PHP_SELF"] ?>' method='post'>
- <p>
- <label for="strPassword">Password: </label>
- <input type='text' name='strPassword' id='strPassword'/></p>
- <p><input type='submit' name='submit'/></p>
- </form>
- <?php
- $arrUsers = array (0 => "gorgor", 1 => "dwt", 2 => "bedlamsticks");
- $arrPassword = array (0 => "tyrantlizard", 1 => "slowmentaltorture", 2 => "carnivore");
- if (isset($_POST["submit"])){
- $strUser = $_POST["strUser"];
- $strPassword = $_POST["strPassword"];
- if (in_array($strUser, $arrUsers)) {
- $intKey = key($arrUsers);
- if (in_array($strPassword, $arrPassword[$intKey])) {
- echo "Username and Password match!";
- }
- else
- echo "Incorrect Password.";
- }
- else
- echo "No such Username found.";
- }
- //echo "<p> $strNewPasswordEncrypted</p>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement