-
Notifications
You must be signed in to change notification settings - Fork 0
/
signupback.php
51 lines (49 loc) · 2.01 KB
/
signupback.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
51
<?php
session_start();
$username = filter_input(INPUT_POST, 'username');
$password = filter_input(INPUT_POST, 'password');
$c_id = filter_input(INPUT_POST, 'c_id');
$c_ph = filter_input(INPUT_POST, 'c_ph');
$email = filter_input(INPUT_POST, 'email');
$address = filter_input(INPUT_POST, 'address');
$experience = filter_input(INPUT_POST, 'experience');
$r_password = filter_input(INPUT_POST, 'rpassword');
if (!empty($username)) {
if (!empty($address)) {
if (!empty($c_ph)) {
if (!empty($email)) {
if (!empty($experience)) {
if (!empty($password)) {
if ($password == $r_password) {
require "dbh.php";
$hashedpwd = password_hash($password, PASSWORD_DEFAULT);
$sql = "Insert into customer(C_Name,Address,C_Ph_Number,Email,Exp,C_Pass)
values('$username','$address','$c_ph','$email','$experience','$hashedpwd')";
if ($conn->query($sql)) {
echo "Sign Up successfull.";
header("Location: timeoutup2in.html");
} else {
echo "Error" . $sql . "<br>" . $conn->error;
}
$conn->close();
} else {
echo "<script>alert('Password deos not match!');window.location='signup.html'</script>";
}
} else {
echo "Password should not be empty";
}
} else {
echo "Experience should not be empty";
}
} else {
echo "Email should not be empty";
}
} else {
echo "Phone Number should not be empty";
}
} else {
echo "Address should not be empty";
}
} else {
echo "Username should not be empty";
}