Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.     session_start();
  3.     $username = $_POST['username'];
  4.     $password = $_POST['password'];
  5.    
  6.     if ($username == "zanacross" && $password == "lkjhm1") {
  7.         $_SESSION['logged'] = 1;
  8.     }
  9.     if (!isset($_SESSION['logged'])) {
  10.         echo '<form name="login" action="login.php" method="post">
  11.         <input type="text" name="username" />
  12.         <input type="password" name="password" />
  13.         <button type="submit">Submit</button>
  14.         </form>';
  15.     }
  16.     else {
  17.         echo "You are logged in";
  18.     }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement