Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $con = mysqli_connect("127.0.0.1","root","", "yield");
- $name = $_POST["name"];
- $age = $_POST["age"];
- $username = $_POST["username"];
- $password = $_POST["password"];
- $last_name = $_POST["last_name"];
- $address = $_POST["address"];
- $email = $_POST["email"];
- $phone_number = $_POST["phone_number"];
- $postal_code = $_POST["postal_code"];
- $country = $_POST["country"];
- $repeat_password = $_POST["repeat_password"]
- if(isset($password) == isset($repeat_password){
- $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));
- mysqli_stmt_bind_param($statement, "ssissssiis", $name, $username, $age, $password, $last_name, $address, $email, $phone_number, $postal_code, $country);
- mysqli_stmt_execute($statement);
- $response = array();
- $response["success"] = true;
- echo json_encode($response);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement