-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
397 lines (363 loc) · 21.1 KB
/
signup.php
File metadata and controls
397 lines (363 loc) · 21.1 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
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
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
<?php
$showAlert = false;
$showError = false;
if ($_SERVER["REQUEST_METHOD"] == "POST") {
include 'compo/_dbconnect.php';
$name = $_POST['name'];
$email = $_POST["email"];
$password = $_POST["password"];
$cpassword = $_POST["cpassword"];
$exists = false;
$existSql = "SELECT * FROM `users` WHERE email = '$email'";
$result = mysqli_query($conn, $existSql);
$numExistRows = mysqli_num_rows($result);
if ($numExistRows > 0) {
$showError = "Email Already Exists";
} else {
if ($password == $cpassword) {
$hash = password_hash($password, PASSWORD_DEFAULT);
$sql = "INSERT INTO `users` (`name`,`email`, `password`, `dt`) VALUES ('$name', '$email', '$hash', current_timestamp())";
$result = mysqli_query($conn, $sql);
if ($result) {
$showAlert = true;
} else {
$showError = "Failed to insert record";
}
} else {
$showError = "Passwords do not match";
}
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign up - PawRangers</title>
<link rel="shortcut icon" href="./favicon.svg" type="image/svg+xml">
<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.css" rel="stylesheet" />
<style>
@font-face {
font-family: 'd_sariultrablack';
src: url('dsariultrablack-webfont.woff2') format('woff2'),
url('dsariultrablack-webfont.woff') format('woff');
}
.logo {
font-family: 'd_sariultrablack';
}
.btn {
background-color: rgb(33, 30, 30);
color: white;
max-width: max-content;
padding: 10px 37px;
border-radius: 50px;
transition: ease-in 0.1s;
}
.btn:hover {
background-color: black;
}
.error {
width: 320px;
padding: 12px;
display: flex;
position:absolute;
top:5rem;
right:2rem;
flex-direction: row;
align-items: center;
justify-content: start;
background: #db4122;
border-radius: 8px;
box-shadow: 0px 0px 5px -3px #111;
}
.error__icon {
width: 20px;
height: 20px;
transform: translateY(-2px);
margin-right: 8px;
}
.error__icon path {
fill: #fff;
}
.error__title {
font-weight: 500;
font-size: 14px;
color: #fff;
}
.error__close {
width: 20px;
height: 20px;
cursor: pointer;
margin-left: auto;
}
.error__close path {
fill: #fff;
}
.success {
width: 320px;
padding: 12px;
display: flex;
position:absolute;
top:5rem;
right:2rem;
flex-direction: row;
align-items: center;
justify-content: start;
background: #259621;
border-radius: 8px;
box-shadow: 0px 0px 5px -3px #111;
}
.success__icon {
width: 20px;
height: 20px;
transform: translateY(-2px);
margin-right: 8px;
}
.success__icon path {
fill: #fff;
}
.sucesss__title {
font-weight: 500;
font-size: 14px;
color: #fff;
}
.success__close {
width: 20px;
height: 20px;
cursor: pointer;
margin-left: auto;
}
.success__close path {
fill: #fff;
}
</style>
</head>
<body class="bg-gray-100">
<!--Navbar-->
<nav class="bg-gray-100 border border-gray-200">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<a href="index.php" class="flex items-center space-x-3 rtl:space-x-reverse">
<img src="icon.svg" class="h-8" alt="logo" />
<span
class="logo self-center text-2xl font-bold text-black whitespace-nowrap dark:text-white">PawRangers</span>
</a>
<button data-collapse-toggle="navbar-default" type="button"
class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
aria-controls="navbar-default" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none"
viewBox="0 0 17 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M1 1h15M1 7h15M1 13h15" />
</svg>
</button>
<div class="hidden w-full bg-gray-50 md:block md:w-auto" id="navbar-default">
<ul
class="font-medium bg-gray-100 flex flex-col p-4 md:p-0 mt-4 border border-gray-100 md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0 md:bg-gray-100 dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700">
<li>
<a href="about.php"
class="block py-2 px-3 text-green-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-green-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">About</a>
</li>
<li>
<a href="donate.php"
class="block py-2 px-3 text-green-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-green-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Donate</a>
</li>
<li>
<button id="dropdownNavbarLink" data-dropdown-toggle="dropdownNavbar"
class="flex items-center justify-between w-full py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-white md:dark:hover:text-blue-500 dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent">Pets<svg
class="w-2.5 h-2.5 ms-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
stroke-width="2" d="m1 1 4 4 4-4" />
</svg></button>
<!-- Dropdown menu -->
<div id="dropdownNavbar"
class="z-10 hidden font-normal bg-white divide-y divide-gray-100 rounded-lg shadow w-44 dark:bg-gray-700 dark:divide-gray-600">
<ul class="py-2 text-sm text-gray-700 dark:text-gray-400"
aria-labelledby="dropdownLargeButton">
<li>
<a href="dogs.php"
class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Dogs</a>
</li>
<li>
<a href="cats.php"
class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Cats</a>
</li>
<li>
<a href="others.php"
class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white">Others</a>
</li>
</ul>
</div>
</li>
<li>
<a href="shelter.php"
class="block py-2 px-3 text-green-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-green-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Shelters</a>
</li>
<li>
<a href="listpet.php"
class="block py-2 px-3 text-green-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-green-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">List
your Pets</a>
</li>
</ul>
</div>
</div>
</nav>
<!--Alert-->
<?php
if ($showAlert) {
echo '<div class="success">
<div class="success__icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" viewBox="0 0 24 24" height="24" fill="none"><path fill="#393a37" d="m13 13h-2v-6h2zm0 4h-2v-2h2zm-1-15c-1.3132 0-2.61358.25866-3.82683.7612-1.21326.50255-2.31565 1.23915-3.24424 2.16773-1.87536 1.87537-2.92893 4.41891-2.92893 7.07107 0 2.6522 1.05357 5.1957 2.92893 7.0711.92859.9286 2.03098 1.6651 3.24424 2.1677 1.21325.5025 2.51363.7612 3.82683.7612 2.6522 0 5.1957-1.0536 7.0711-2.9289 1.8753-1.8754 2.9289-4.4189 2.9289-7.0711 0-1.3132-.2587-2.61358-.7612-3.82683-.5026-1.21326-1.2391-2.31565-2.1677-3.24424-.9286-.92858-2.031-1.66518-3.2443-2.16773-1.2132-.50254-2.5136-.7612-3.8268-.7612z"></path></svg>
</div>
<div class="sucesss__title">Success! Your Information has been stored.</div>
</div>';
}
if ($showError) {
echo '<div class="error">
<div class="error__icon">
<svg xmlns="http://www.w3.org/2000/svg" width="24" viewBox="0 0 24 24" height="24" fill="none"><path fill="#393a37" d="m13 13h-2v-6h2zm0 4h-2v-2h2zm-1-15c-1.3132 0-2.61358.25866-3.82683.7612-1.21326.50255-2.31565 1.23915-3.24424 2.16773-1.87536 1.87537-2.92893 4.41891-2.92893 7.07107 0 2.6522 1.05357 5.1957 2.92893 7.0711.92859.9286 2.03098 1.6651 3.24424 2.1677 1.21325.5025 2.51363.7612 3.82683.7612 2.6522 0 5.1957-1.0536 7.0711-2.9289 1.8753-1.8754 2.9289-4.4189 2.9289-7.0711 0-1.3132-.2587-2.61358-.7612-3.82683-.5026-1.21326-1.2391-2.31565-2.1677-3.24424-.9286-.92858-2.031-1.66518-3.2443-2.16773-1.2132-.50254-2.5136-.7612-3.8268-.7612z"></path></svg>
</div>
<div class="error__title">Error! '. $showError .'</div>
</div>';
}
?>
<!--Signup-->
<section class="bg-gray-100 dark:bg-gray-900">
<div class="flex flex-col items-center justify-center px-8 py-9 mx-10 my-10 ">
<div
class="w-auto bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dark:bg-gray-800 dark:border-gray-700">
<div class="p-6 space-y-4 md:space-y-6 sm:p-8">
<h1 class="text-3xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl">
Sign
up
</h1>
<form class="space-y-4 md:space-y-6" action="/paws/signup.php" method="post">
<div>
<label for="name" class="block mb-2 text-sm font-light text-gray-900 dark:text-white">Your
Name</label>
<input type="text" name="name" id="name"
class="bg-gray-50 border transition duration-100 border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="eg. Ray, Ankur" required="">
</div>
<div>
<label for="email" class="block mb-2 text-sm font-light text-gray-900 dark:text-white">Your
email</label>
<div class="relative mb-6">
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
<svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true"
xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 16">
<path
d="m10.036 8.278 9.258-7.79A1.979 1.979 0 0 0 18 0H2A1.987 1.987 0 0 0 .641.541l9.395 7.737Z" />
<path
d="M11.241 9.817c-.36.275-.801.425-1.255.427-.428 0-.845-.138-1.187-.395L0 2.6V14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2.5l-8.759 7.317Z" />
</svg>
</div>
<input type="email" name="email" id="email"
class="bg-gray-50 border transition duration-100 border-gray-300 text-gray-900 sm:text-sm rounded-lg ps-10 focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="eg. gccba@gmail.com" required="">
</div>
</div>
<div>
<label for="password" class="block mb-2 text-sm font-light text-gray-900 dark:text-white">Your
Password</label>
<div class="relative mb-6">
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#6B7280"
class="w-5 h-5">
<path fill-rule="evenodd"
d="M8 7a5 5 0 1 1 3.61 4.804l-1.903 1.903A1 1 0 0 1 9 14H8v1a1 1 0 0 1-1 1H6v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 .293-.707L8.196 8.39A5.002 5.002 0 0 1 8 7Zm5-3a.75.75 0 0 0 0 1.5A1.5 1.5 0 0 1 14.5 7 .75.75 0 0 0 16 7a3 3 0 0 0-3-3Z"
clip-rule="evenodd" />
</svg>
</div>
<input type="password" name="password" id="password"
class="bg-gray-50 border transition duration-100 border-gray-300 text-gray-900 sm:text-sm rounded-lg ps-10 focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="••••••••" required="">
</div>
</div>
<div>
<label for="cpassword"
class="block mb-2 text-sm font-light text-gray-900 dark:text-white">Confirm
Password</label>
<div class="relative mb-2">
<div class="absolute inset-y-0 start-0 flex items-center ps-3.5 pointer-events-none">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="#6B7280"
class="w-5 h-5">
<path fill-rule="evenodd"
d="M8 7a5 5 0 1 1 3.61 4.804l-1.903 1.903A1 1 0 0 1 9 14H8v1a1 1 0 0 1-1 1H6v1a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-2a1 1 0 0 1 .293-.707L8.196 8.39A5.002 5.002 0 0 1 8 7Zm5-3a.75.75 0 0 0 0 1.5A1.5 1.5 0 0 1 14.5 7 .75.75 0 0 0 16 7a3 3 0 0 0-3-3Z"
clip-rule="evenodd" />
</svg>
</div>
<input type="password" name="cpassword" id="cpassword"
class="bg-gray-50 border transition duration-100 border-gray-300 text-gray-900 sm:text-sm rounded-lg ps-10 focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="••••••••" required="">
</div>
</div>
<button type="submit" class="btn">Create an Account</button>
<p class="text-sm font-medium text-black dark:text-gray-400">
Have an account? <a href="login.php"
class="font-bold transition duration-200 text-black hover:underline dark:text-primary-500">Log
in</a>
</p>
</form>
</div>
</div>
</div>
</section>
<!--Footer-->
<footer class="bg-white rounded-lg shadow dark:bg-gray-900 m-4 mt-10">
<div class="w-full max-w-screen-xl mx-auto p-4 md:py-8">
<div class="sm:flex sm:items-center sm:justify-between">
<a href="index.php" class="flex items-center mb-4 sm:mb-0 space-x-3 rtl:space-x-reverse">
<span
class="logo self-center text-2xl font-semibold whitespace-nowrap dark:text-white">PawRangers</span>
</a>
<ul
class="flex flex-wrap items-center mb-6 text-sm font-medium text-gray-500 sm:mb-0 dark:text-gray-400">
<li>
<a href="about.php" class="hover:underline me-4 md:me-6">About</a>
</li>
<li>
<a href="shelter.php" class="hover:underline me-4 md:me-6">ToS</a>
</li>
<li>
<a href="shelter.php" class="hover:underline me-4 md:me-6">Contact</a>
</li>
<li>
<a href="listpet.php" class="hover:underline">Privacy Policy</a>
</li>
</ul>
</div>
<hr class="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8" />
<div class="sm:flex sm:items-center sm:justify-between">
<span class="text-sm text-gray-500 sm:text-center dark:text-gray-400">© 2024 <a href="easteregg.php"
class="hover:underline">PawRangers™</a>. All Rights Reserved.
</span>
<div class="flex mt-4 sm:justify-center sm:mt-0">
<a href="https://www.facebook.com/maniphartiyal/"
class="text-gray-500 hover:text-gray-900 dark:hover:text-white">
<svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
viewBox="0 0 8 19">
<path fill-rule="evenodd"
d="M6.135 3H8V0H6.135a4.147 4.147 0 0 0-4.142 4.142V6H0v3h2v9.938h3V9h2.021l.592-3H5V3.591A.6.6 0 0 1 5.592 3h.543Z"
clip-rule="evenodd" />
</svg>
<span class="sr-only">Facebook page</span>
</a>
<a href="https://twitter.com/noice_ray"
class="text-gray-500 hover:text-gray-900 dark:hover:text-white ms-5">
<svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
viewBox="0 0 20 17">
<path fill-rule="evenodd"
d="M20 1.892a8.178 8.178 0 0 1-2.355.635 4.074 4.074 0 0 0 1.8-2.235 8.344 8.344 0 0 1-2.605.98A4.13 4.13 0 0 0 13.85 0a4.068 4.068 0 0 0-4.1 4.038 4 4 0 0 0 .105.919A11.705 11.705 0 0 1 1.4.734a4.006 4.006 0 0 0 1.268 5.392 4.165 4.165 0 0 1-1.859-.5v.05A4.057 4.057 0 0 0 4.1 9.635a4.19 4.19 0 0 1-1.856.07 4.108 4.108 0 0 0 3.831 2.807A8.36 8.36 0 0 1 0 14.184 11.732 11.732 0 0 0 6.291 16 11.502 11.502 0 0 0 17.964 4.5c0-.177 0-.35-.012-.523A8.143 8.143 0 0 0 20 1.892Z"
clip-rule="evenodd" />
</svg>
<span class="sr-only">Twitter page</span>
</a>
</div>
</div>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script>
</body>
</html>