Advertisement
Guest User

Untitled

a guest
Apr 10th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. // example form in register page
  2. <form action="post.php">
  3.  
  4. <input type="hidden" name="action" value="register">
  5.  
  6. <input type="text" name="email">
  7.  
  8. <input type="text" name="username">
  9.  
  10. <input type="password" name="email">
  11.  
  12.  
  13. <input type="submit" value="register">
  14.  
  15. </form>
  16.  
  17.  
  18. //post.php file
  19.  
  20. // check to see what action we are dealing with
  21. if( isset($_POST['action']) && $_POST['action'] == 'register' ) {
  22.  
  23.  // check to see if all the fields have been posted
  24.  if( isset($_POST['username']) && isset($_POST['email']) && isset($_POST['password']) ) {
  25.  
  26.    // store into variables for use
  27.    $email = $_POST['email'];
  28.    $username = $_POST['username'];
  29.    $password = $_POST['password'];
  30.    //rest of code...
  31.  
  32.  }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement