Advertisement
Guest User

Untitled

a guest
Mar 15th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include("passwords.php");
  4. if ($_POST["ac"]=="log") {
  5. if ($USERS[$_POST["username"]]==$_POST["password"]) {
  6. $_SESSION["logged"]=$_POST["username"];
  7. } else {
  8. echo 'Incorrect username/password. Please, try again.';
  9. };
  10. };
  11. if (array_key_exists($_SESSION["logged"],$USERS)) {
  12. echo "You're logged in.";
  13. } else {
  14. echo '<form action="login.php" method="post"><input type="hidden" name="ac" value="log"> ';
  15. echo 'Username: <input type="text" name="username" /><br />';
  16. echo 'Password: <input type="password" name="password" /><br />';
  17. echo '<input type="submit" value="Login" />';
  18. echo '</form>';
  19. };
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement