Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include("passwords.php");
- if ($_POST["ac"]=="log") {
- if ($USERS[$_POST["username"]]==$_POST["password"]) {
- $_SESSION["logged"]=$_POST["username"];
- } else {
- echo 'Incorrect username/password. Please, try again.';
- };
- };
- if (array_key_exists($_SESSION["logged"],$USERS)) {
- echo "You're logged in.";
- } else {
- echo '<form action="login.php" method="post"><input type="hidden" name="ac" value="log"> ';
- echo 'Username: <input type="text" name="username" /><br />';
- echo 'Password: <input type="password" name="password" /><br />';
- echo '<input type="submit" value="Login" />';
- echo '</form>';
- };
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement