Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title></title>
- </head>
- <body>
- <?php
- Session_start();
- $passwords = array("nate" => "letmein",
- "alaxic" => "thisisme");
- if (!$_POST["username"] or !$_POST["password"]) {
- echo "You must enter your username and password";
- exit;
- }
- if ($_POST["password"] == $passwords[$_POST["username"]]) {
- echo "Login successful!";
- $_SESSION["auth_username"] = $_POST["username"];
- }
- else {
- echo "Login incorrect. Please try again.";
- }
- ?>
- <FORM ACTION="login.php" METHOD="POST">
- <TABLE BORDER=0>
- <TR>
- <TD>Username:</TD>
- <TD><INPUT TYPE="TEXT" SIZE=10 NAME="username"></TD>
- </TR>
- <TR>
- <TD>Password:</TD>
- <TD><INPUT TYPE="PASSWORD" SIZE=10 NAME="password"></TD>
- </TR>
- </TABLE>
- <INPUT TYPE=SUBMIT VALUE="Log in">
- </FORM>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement