-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequest.php
More file actions
34 lines (28 loc) · 1.06 KB
/
request.php
File metadata and controls
34 lines (28 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$servername='localhost';
$username='root';
$password='';
$dbname = "data_form";
$conn=mysqli_connect($servername,$username,$password,$dbname);
if(!$conn){
echo('Could not Connect MySql Server:' .mysql_error());
}
$first_name = $_POST['first_name'];
$last_name=$_POST['last_name'];
if (isset($_POST['sex'])){
$sex = $_POST['sex'];
}
$date_of_birth=$_POST['date_of_birth'];
$email_id = $_POST['email_id'];
$phone_number = $_POST['phone_number'];
$user_id=$_POST['user_id'];
$password=$_POST['password'];
$confirm_password=$_POST['confirm_password'];
$user_id=$_POST['user_id'];
$sql = $conn->prepare("INSERT INTO user_data (first_name,last_name,sex,date_of_birth,email_id,phone_number,user_id,password,confirm_password)
VALUES(?,?,?,?,?,?,?,?,?)");
$sql->bind_param("sssssssss",$first_name,$last_name,$sex,$date_of_birth,$email_id,$phone_number,$user_id,$password,$confirm_password);
$sql->execute();
echo "New records created successfully";
mysqli_close($conn);
?>