-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignUp.php
More file actions
167 lines (140 loc) · 6.69 KB
/
signUp.php
File metadata and controls
167 lines (140 loc) · 6.69 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
$flag = 0;
if(isset($_POST['register'])){
$Fname = $_POST['firstName'];
$Lname = $_POST['lastName'];
$Email = $_POST['email'];
$Address = $_POST['address'];
$Password = sha1($_POST['pass']);
$db = mysqli_connect("localhost", "admin", "123456", "sprinkles");
if (mysqli_connect_error()) {
echo "Error: Unable to connect to database";
die();
}
else {
$stringQ = "select * from `customer`";
$result = $db->query($stringQ);
for ($i = 0; $i < $result->num_rows; $i++) {
$row = $result->fetch_assoc();
if ($Email == $row['email']) {
echo "Email Address is already exist, enter another Email Address";
$flag = 1;
header("Location: signUp.php");
}
}
if($flag == 0) {
$strQ = "INSERT INTO `customer`(`Fname`, `Lname`, `password`, `email`, `address`) VALUES
('$Fname', '$Lname', '$Password', '$Email', '$Address')";
//$res = $db->query($strQ);
if (mysqli_query($db, $strQ)) {
echo "Your Account has been created Successfully";
$db->close();
header("Location: logIn.php");
} else {
echo "ERROR: Could not able to execute";
}
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sign Up - Sprinkles</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<!-- Shortcut Icon -->
<link rel="shortcut icon" href="images/cupcakeIcon.png">
<!--===============================================================================================-->
</head>
<body>
<div class="limiter">
<div class="container-login100">
<div class="wrap-login100">
<div class="login100-pic js-tilt" data-tilt>
<img src="images/cupcake512.png" alt="IMG">
</div>
<form class="login100-form validate-form" action="signUp.php" method="post">
<span class="login100-form-title">
Sign Up
</span>
<div class="wrap-input100 validate-input" aria-required="true">
<input class="input100" type="text" name="firstName" placeholder="First Name">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-user" aria-hidden="true"></i>
</span>
</div>
<div class="wrap-input100 validate-input" aria-required="true">
<input class="input100" type="text" name="lastName" placeholder="Last Name">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-user" aria-hidden="true"></i>
</span>
</div>
<div class="wrap-input100 validate-input" data-validate="Valid email is required: ex@abc.xyz">
<input class="input100" type="text" name="email" placeholder="Email">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-envelope" aria-hidden="true"></i>
</span>
</div>
<div class="wrap-input100 validate-input" aria-required="true">
<input class="input100" type="text" name="address" placeholder="Address">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-address-card" aria-hidden="true"></i>
</span>
</div>
<div class="wrap-input100 validate-input" data-validate="Password is required" aria-required="true">
<input class="input100" type="password" name="pass" placeholder="Password">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-lock" aria-hidden="true"></i>
</span>
</div>
<div class="container-login100-form-btn">
<button class="login100-form-btn" name="register">
Register
</button>
</div>
<div class="text-center p-t-136">
<a class="txt2" href="logIn.php">
<i class="fa fa-long-arrow-left m-l-5" aria-hidden="true"></i> Already have an Account
</a>
</div>
</form>
</div>
</div>
</div>
<!--===============================================================================================-->
<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/bootstrap/js/popper.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
<script src="vendor/tilt/tilt.jquery.min.js"></script>
<script>
$('.js-tilt').tilt({
scale: 1.1
})
</script>
<!--===============================================================================================-->
<script src="js/main.js"></script>
</body>
</html>