AlaminSakib

PHP and Forms

Feb 14th, 2020
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 0.92 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>
  5.         <!-- bootstrap css link -->
  6.     </title>
  7. </head>
  8. <body>
  9.     <?php
  10.         if(isset($_POST['Verify'])) //to check if the name = "submit" button was pressed
  11.         {
  12.             if(!empty($_POST['username']) && !empty($_POST['password']))
  13.             {
  14.                 if($_POST['username'] == "sakib" && $_POST['password'] == "1234")
  15.                 {
  16.                     echo "Logged in";
  17.                     header("location: http://fb.com");
  18.                 }
  19.                 else echo "Onner account e dhukte chas ken?";
  20.  
  21.             }
  22.            
  23.  
  24.         }
  25.     ?>
  26.     <form method="POST" action="">
  27.         <input type="text" name="username"><br>
  28.         <input type="password" name="password"><br>
  29.         <!-- type can be the type of input such as button(type is submit), dropdown etc -->
  30.         <!--name is the name of the attribute that will be used in php-->
  31.         <!-- value is the name that will be displayed on the button or input -->
  32.         <input type="submit" name="Verify" value="Verify">
  33.  
  34.     </form>
  35.  
  36.  
  37. </body>
  38. </html>
Add Comment
Please, Sign In to add comment