-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
32 lines (27 loc) · 978 Bytes
/
Copy pathinsert.php
File metadata and controls
32 lines (27 loc) · 978 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
<?php
$conn = mysqli_connect("localhost", "root", "", "taxibooking");
if (!$conn) {
die("Connection failed");
}
if (
isset($_POST['name']) &&
isset($_POST['email']) &&
isset($_POST['password']) &&
isset($_POST['confirm password'])
) {
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$password = mysqli_real_escape_string($conn, $_POST['password']);
$confirm = mysqli_real_escape_string($conn, $_POST['confirm password']);
$sql = "INSERT INTO userSignUp (name, email, password, confirmpassword)
VALUES ('$name', '$email', '$password', '$confirmpassword')";
$result = mysqli_query($conn, $sql);
if ($result) {
echo "<script>alert('Customer Registered Successfully!');</script>";
header('Location: login.php');
exit();
} else {
echo "Error: " . mysqli_error($conn);
}
}
?>