Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. <?php session_start();
  2. $username='cwarn23';
  3. $password='password';
  4. if (isset($_POST) && !empty($_POST)) {
  5. if ($_POST['user']==$username && $_POST['pass']==$password) {
  6. $_SESSION['user']=$username;
  7. }
  8. }
  9. if (isset($_SESSION['user'])) {
  10. echo 'You are logged in.';
  11. } else {
  12. echo 'Please log in<br><form method="POST">Username: <input type="text" name="user"><br>Password: <input type="text" name="pass"></form>';
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement