/
check.php
350 lines (304 loc) · 9.97 KB
/
check.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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html>
<html>
<head>
<title>Safar</title>
<?php
$f=2;
if(isset($_POST['btn']))
{
$e=$_POST["email"];
$n=$_POST["name"];
$p=$_POST["pass"];
$pc=$_POST["passc"];
$dob=$_POST["dob"];
$g=$_POST["gender"];
$q=$_POST["Security_question"];
$a=$_POST["answer"];
if($g=='male')
{
$c=1;
}
elseif ($g=='female')
{
$c=2;
}
elseif($g=='Others')
{
$c=3;
}
else
{
//
}
if($q=='What is your childhood name?')
{
$d=1;
}
elseif($q=='What is the name of your pet?')
{
$d=2;
}
elseif($q=='What is your favourite color?')
{
$d=3;
}
elseif($q=='Who is your favourite actor?')
{
$d=4;
}
elseif($q=='What is your lucky number?')
{
$d=5;
}
if("$p"=="$pc")
{
$dbc = mysqli_connect('localhost','root','','safar') or die('Error Establishing Connection');
$query = "insert into reg (email,name,password,dob,gender,s_question,s_answer) values('$e','$n','$p','$dob','$g','$q','$a')";
$check=mysqli_query($dbc,$query) or die('Error Fetching tables');
if($check!=0)
{
header("location:safar.php");
}
else
echo "Unable to Register";
}
else
{
$f=1;
}
}
?>
<style type="text/css">
#button{background-color: #DE9683;border:1px solid #DE9683;}
#button:hover{background-color:red;cursor: pointer;border:1px solid red; }
body{
margin:0px;
}
input[type="date"]::-webkit-clear-button {
display: block;
}
input[type="date"]::-webkit-inner-spin-button {
display: none;
}
input[type="date"]::-webkit-calendar-picker-indicator {
color: #2c3e50;
}
::-webkit-scrollbar{
width: 0px;}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #920A10 ;
font-family: candara;
padding-left: 10px;
}
li {
float: left;
}
li a, .dropbtn {
display: inline-block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(9,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
font-family: candara;
}
.dropdown-content a:hover {
background-color: #f1f1f1;cursor: pointer
}
.dropdown:hover .dropdown-content {
display: block;
}
</style>
</head>
<body>
<div>
<ul>
<li><span style="padding: 0;margin-left: 10px;margin-right: 1040px;"><img src="busicon.jpg" height="40px" width="50px"></span></li>
<li class="dropdown">
<a class="dropbtn">Login/Register</a>
<div class="dropdown-content">
<a id="myBtn">Login</a>
<a href="register.php">Register</a>
</div>
</li>
<li><a href="#">Contact us</a></li>
</ul>
</div>
<div style="
position:absolute;
margin-top: 40px;
box-shadow: 0px 8px 16px 0px rgba(9,0,0,0.2);;
margin-top:0px;
background-color:#f9f9f9;
margin-left:500px;
padding: 15px;
">
<table><form action="<?php $_PHP_SELF ?>" method="post">
<tr>
<th style="font-size: 20px;font-family: cursive;" align="center">
SignUp
</th>
</tr>
<tr>
<td>
<hr>
</td>
</tr>
<tr>
<td>
<input type="email" name="email" required placeholder="Email" title="Enter Your Email"
value="<?php if(isset($_POST["email"])) echo $_POST["email"]; ?>"
style="
border:1px solid #ccc;
height: 30px;
font-size: 15px;
padding: 5px;
width: 300px;
">
</td>
</tr>
<tr>
<td>
<input type="text" name="name" required placeholder="Full Name" title="Enter Your Full Name"
value="<?php if(isset($_POST["name"])) echo $_POST["name"]; ?>"
style="
border:1px solid #ccc;
height: 30px;
font-size: 15px;
padding: 5px;
width: 300px;
">
</td>
</tr>
<tr>
<td>
<input type="password" name="pass" required placeholder="Password" title="Enter Your Password"
style="
border:1px solid #ccc;
height: 30px;
font-size: 15px;
padding: 5px;
width: 300px;
">
</td>
</tr>
<tr>
<td>
<input type="Password" name="passc" required placeholder="Confirm Password" title="Confirm Your Password"
style="
border:1px solid #ccc;
height: 30px;
font-size: 15px;
padding: 5px;
width: 300px;
">
</td>
</tr>
<tr>
<td>
<input type="date" name="dob" required placeholder="DOB" title="Enter Your Date Of Birth"
value="<?php if(isset($_POST["dob"])) echo $_POST["dob"]; ?>"
style="
border:1px solid #ccc;
height: 30px;
font-size: 15px;
padding: 5px;
width: 300px;
">
</td>
</tr>
<tr>
<td>
<input type="radio" name="gender" value="male" <?php if(isset($_POST["gender"])) {if($c==1) echo 'checked'; } ?> ><span style="font-family: cursive;">Male</span>
<input type="radio" name="gender" value="female" <?php if(isset($_POST["gender"])) { if($c==2) echo 'checked';} ?> ><span style="font-family: cursive;margin-left: 5px;">Female</span>
<input type="radio" name="gender" value="Others" <?php if(isset($_POST["gender"])) { if($c==3) echo 'checked';} ?> ><span style="font-family: cursive;margin-left: 5px;">Others</span>
</td>
</tr>
<tr>
<th style="font-size: 20px;font-family: cursive;" align="center">
Security Question
</th>
</tr>
<tr>
<td>
<hr>
</td>
</tr>
<tr>
<td>
<input type="radio" name="Security_question" value="What is your childhood name?" <?php if(isset($_POST["Security_question"])) {if($d==1) echo 'checked'; } ?> ><span>What is your childhood name?</span>
</td>
</tr>
<tr>
<td>
<input type="radio" name="Security_question" value="What is the name of your pet?" <?php if(isset($_POST["Security_question"])) {if($d==2) echo 'checked'; } ?> ><span>What is the name of your pet?</span>
</td>
</tr>
<tr>
<td>
<input type="radio" name="Security_question" value="What is your favourite color?" <?php if(isset($_POST["Security_question"])) {if($d==3) echo 'checked'; } ?>><span>What is your favourite color?</span>
</td>
</tr>
<tr>
<td>
<input type="radio" name="Security_question" value="Who is your favourite actor?" <?php if(isset($_POST["Security_question"])) {if($d==4) echo 'checked'; } ?>><span>Who is your favourite actor?</span>
</td>
</tr>
<tr>
<td>
<input type="radio" name="Security_question" value="What is your lucky number?" <?php if(isset($_POST["Security_question"])) {if($d==5) echo 'checked'; } ?>><span>What is your lucky number?</span>
</td>
</tr>
<tr>
<td>
<input type="text" name="answer" required placeholder="Your Answer" title="Enter Your Answer"
value="<?php if(isset($_POST["answer"])) { echo $_POST["answer"]; } ?>"
style="
border:1px solid #ccc;
height: 30px;
font-size: 15px;
padding: 5px;
width: 300px;
">
</td>
</tr>
<tr>
<td align="right">
<input id="button" type="submit" name="btn" value="Next"
style="
border-radius: 5px;
height: 40px;
color: white;
width: 100px;
">
</td>
</tr>
</table>
<div align="center" style="color: red;padding-top: 5px;"><b><?php if($f==1) echo "Password Does Not Matched"; ?></b></div>
</div>
</body>
</html>