Advertisement
Guest User

Untitled

a guest
May 30th, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. <?php
  2. //you need name property to send to post on forms
  3.  
  4. if(isset($_POST['submit'])){
  5.    
  6.    
  7.     //check for submit posting correctly?
  8. $username = $_POST['username'];
  9. $password = $_POST['password'];
  10.    
  11.     echo "hello $username";
  12.     echo " <br> Your password is $password";
  13.    
  14. }
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21. ?>
  22.  
  23.  
  24. <!DOCTYPE html>
  25. <html lang="en">
  26. <head>
  27.     <meta charset="UTF-8">
  28.     <title>WORMY DOG</title>
  29. </head>
  30. <body>
  31.  
  32.  <!-- check for isset in #_post with submit -->
  33.  <form action="form.php" method="post">
  34.      <input type="text" placeholder="Enter Username" name="username">
  35.      <br>
  36.      <input type="password" placeholder="Enter Password" name="password">
  37.      <br>
  38.      <input type="submit" name="submit">
  39.      
  40.      
  41.  </form>
  42.  
  43.    
  44.           <?php
  45.    
  46.  
  47.    
  48.  
  49.    
  50.     ?>
  51. </body>
  52. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement