Guest User

Untitled

a guest
Nov 10th, 2017
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. <?php
  2. require 'connect.forum.signup.php';
  3.  
  4. $first_name = '';
  5. $last_name = '';
  6. $username = '';
  7. $date_of_birth = '';
  8. $email ='';
  9. $phone_number = '';
  10. $password = '';
  11.  
  12. $first_name = @_POST['first_name'];
  13. $last_name = @_POST['last_name'];
  14. $username = @_POST['username'];
  15. $date_of_birth = @_POST['date_of_birth'];
  16. $email = @_POST['email'];
  17. $phone_number = @_POST['phone_number'];
  18. $password = @_POST['password'];
  19.  
  20.  
  21. if( isset($first_name, $last_name, $username, $email, $password, $phone_number, $date_of_birth)){
  22. if(!empty($first_name) and !empty($last_name) and !empty($username) and !empty($email) and !empty($phone_number) and !empty($password)){
  23.  
  24. $query = "INSERT INTO user(user_id, first_name, last_name, user_name, date_of_birth, email, phone_number, password)
  25. VALUES(NULL, '$first_name', '$last_name', '$username', '$date_of_birth' , '$email', '$phone_number', '$password')" ;
  26.  
  27. if($query_run = mysqli_query($con, $query)){
  28. header('Location: index.php');
  29. }else{
  30. echo 'Sorry, something went wrong!';
  31. }
  32. }else{
  33. echo 'not good to go ';
  34. }
  35. }else{
  36. echo 'cannot set1';
  37. }
  38. ?>
  39.  
  40. <form method="post">
  41. <input type="text" placeholder="First Name" name="first_name"><br>
  42. <input type="text" placeholder="Last Name" name="last_name"><br>
  43. <input type="text" placeholder="Username" name="username"><br>
  44. <input type="date" placeholder="Date Of Birth" name="date_of_birth"><br>
  45. <input type="email" placeholder="E-mail Id" name="email"><br>
  46. <input type="number" placeholder="Mobile Number" name="phone_number"><br>
  47. <input type="password" placeholder="Password" class="form-control" name="password"><br>
  48. <input type="password" placeholder="Confirm Password"><br>
  49. <button type="submit" >Make me a member!</button><br>
  50. </form>
  51.  
  52. $query = "INSERT INTO user(user_id, first_name, last_name, user_name, date_of_birth, email, phone_number, password)
  53. VALUES(NULL, 'fname', 'lname', 'uname', '1998-06-30' , 'a@b.com', '9876543210', 'pass')" ;
Add Comment
Please, Sign In to add comment