-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
34 lines (25 loc) · 788 Bytes
/
insert.php
File metadata and controls
34 lines (25 loc) · 788 Bytes
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 = "kolposadhon_database";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("INSERT INTO users(name,email,address,password,birth_date,phone_number) VALUES(?,?,?,?,?,?)");
$stmt->bind_param("ssssss", $name, $email, $adrs,$pass,$dob,$phn);
$name=$_POST["user_name"];
$email=$_POST["email"];
$adrs=$_POST["address"];
$pass=$_POST["password"];
$dob=$_POST["DOB"];
$phn=$_POST["phn_num"];
$stmt->execute();
echo "New record created successfully";
$conn->close();
header("Location: http://localhost/kolposadhonProject/signup.php");
exit;
?>