Advertisement
Guest User

Untitled

a guest
Oct 6th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <?php
  2.  
  3. $con = mysqli_connect("127.0.0.1","root","", "yield");
  4.  
  5.  
  6. $name = $_POST["name"];
  7. $age = $_POST["age"];
  8. $username = $_POST["username"];
  9. $password = $_POST["password"];
  10. $last_name = $_POST["last_name"];
  11. $address = $_POST["address"];
  12. $email = $_POST["email"];
  13. $phone_number = $_POST["phone_number"];
  14. $postal_code = $_POST["postal_code"];
  15. $country = $_POST["country"];
  16. $repeat_password = $_POST["repeat_password"]
  17.  
  18. if(isset($password) == isset($repeat_password){
  19. $statement = mysqli_prepare($con, "INSERT INTO users (name, username, age, password, last_name, address, email, phone_number, postal_code, country) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") or die (mysqli_error($con));
  20. mysqli_stmt_bind_param($statement, "ssissssiis", $name, $username, $age, $password, $last_name, $address, $email, $phone_number, $postal_code, $country);
  21. mysqli_stmt_execute($statement);
  22. $response = array();
  23. $response["success"] = true;
  24. echo json_encode($response);
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement