-
Notifications
You must be signed in to change notification settings - Fork 0
/
signUP.php
50 lines (37 loc) · 1.05 KB
/
signUP.php
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<body>
<?php
$servername = 'localhost';
$username = 'root';
$password = '';
$dbname = 'project';
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die('Connection failed: ' . $conn->connect_error);
}
$showalert= false;
$fName = $_POST['fName'];
$lName = $_POST['lName'];
$email = $_POST['emailS'];
$password = $_POST['passwordS'];
$cpasswordS = $_POST['cpasswordS'];
$addressS = $_POST['addressS'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
if($password != $cpasswordS)
{
echo "<script> alert(' Please enter same password')</script>";
}
else
{
$sql = "INSERT INTO signUp(F_Name, L_Name, Email, Password, Address, City, State, Pin_code) VALUES ('$fName','$lName','$email','$password','$addressS','$city','$state','$zip');";
}
if ($conn->query($sql) === true) {
$showalert=true;
echo ' <b>Form submitted successfully. Thank you!</b>';
} else {
echo 'Error: ' . $sql . '<br>' . $conn->error;
}
$conn->close();
?>
</body>