khirulnizam

Untitled

Jul 28th, 2020
2,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <!-- file1 : login-combined.php -->
  3. <html>
  4. <body>
  5. <h2>Login form</h2>
  6. <form action=""
  7.     method="get">
  8.   Username *<br>
  9.   <input type="text"
  10.   name="username" ><br>
  11.   Password *<br>
  12.   <input type="password"
  13.    name="password" ><br><br>
  14.   <input type="submit" value="Login">
  15. </form>
  16.  
  17. <hr>
  18.  
  19. <?php
  20. // php.net/isset
  21. //FETCH both input
  22. if (isset($_GET['username'])){
  23.  
  24.     $username=$_GET['username'];
  25.     $password=$_GET['password'];
  26.  
  27.  
  28. //check the content
  29.     if($username==null){
  30.         //username blank
  31.         echo "Do provide your username<br>";
  32.     }
  33.     else if($password==null){
  34.         //password blank
  35.         echo "Do provide your password<br>";
  36.     }
  37.     else {
  38.         //do db comparison
  39.         //DISPLAY all input value
  40.         echo "Your username
  41.                 is $username <br>";
  42.         echo "Your dummy password
  43.                 is ****** <br>";
  44.     }
  45. }//isset
  46. ?>
  47.  
  48. </body>
  49. </html>
  50.  
Advertisement
Add Comment
Please, Sign In to add comment