Advertisement
Guest User

Untitled

a guest
Feb 14th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. $logged_in = false;
  4.  
  5. if(isset($_POST['username']) && isset($_POST['password'])){
  6.     $username = $_POST['username'];
  7.     $password = $_POST['password'];
  8.  
  9.     if($username === 'Ahmad' && $password === '123'){
  10.         echo "Logged in !";
  11.         $logged_in = true;
  12.     }
  13.     else
  14.         echo "Worng Credentials !";
  15.  
  16. }
  17.  
  18. if(!$logged_in){
  19. ?>
  20.  
  21. <form action="" method="post">
  22.     <input type="text" name="username" placeholder="Username">
  23.     <input type="password" name="password" placeholder="Password">
  24.     <input type="submit">
  25. </form>
  26.  
  27. <?php }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement