-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingup.php
122 lines (105 loc) · 5.68 KB
/
singup.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
<?php
$emailError = false;
$passError = false;
if (isset($_GET['success']) && $_GET['success'] == 'false') {
if (isset($_GET['error']) && $_GET['error'] == 'email') {
$emailError = true;
} elseif (isset($_GET['error']) && $_GET['error'] == 'password') {
$passError = true;
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Singup</title>
<link rel="stylesheet" href="./src/styles.css">
</head>
<body>
<div class="main w-full mb bg-gray-800 flex items-center flex-col ">
<!-- Alert -->
<?php
if ($emailError) {
echo '
<div class="error alert-border-1" role="alert">
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
</svg>
<div class="ms-3 text-sm font-medium">
An account with this email already exists. Please use a different email or log in.
</div>
<button type="button" class="error-close close" data-dismiss-target="#alert-border-1" aria-label="Close">
<span class="sr-only">Dismiss</span>
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
</svg>
</button>
</div>
';
} elseif ($passError) {
echo '
<div class="error alert-border-1" role="alert">
<svg class="flex-shrink-0 w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M10 .5a9.5 9.5 0 1 0 9.5 9.5A9.51 9.51 0 0 0 10 .5ZM9.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3ZM12 15H8a1 1 0 0 1 0-2h1v-3H8a1 1 0 0 1 0-2h2a1 1 0 0 1 1 1v4h1a1 1 0 0 1 0 2Z" />
</svg>
<div class="ms-3 text-sm font-medium">
The passwords you entered do not match. Please try again.
</div>
<button type="button" class="error-close close" data-dismiss-target="#alert-border-1" aria-label="Close">
<span class="sr-only">Dismiss</span>
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6" />
</svg>
</button>
</div>
';
}
?>
<div class=" mt-14">
<img src="./src/images/logo.png" alt="" srcset="">
</div>
<div class="p-4 text-xl text-white"> Create an account to continue.</div>
<div class="w-full max-w-xs mb-7">
<form action="./particles/handleSingup.php" method="post" class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="username">
Username
</label>
<input required class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="username" name="username" type="text" placeholder="Username">
</div>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="useremail">
Email
</label>
<input required class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" name="useremail" type="email" placeholder="Email">
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="password">
Password
</label>
<input required required class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="password" name="password" type="password" placeholder="******************">
<!-- <p class="text-red-500 text-xs italic">Please choose a password.</p> -->
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="password">
Confirm Password
</label>
<input required required class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="password" type="password" placeholder="******************" name="ConfPassword">
<!-- <p class="text-red-500 text-xs italic">Please choose a password.</p> -->
</div>
<div class="flex items-center justify-between">
<button class="btn2" type="sumbit">
Sign In
</button>
</div>
<div class="flex items-center justify-between mt-2">
<span>Existing user?<a href="./login.php"><span class=" font-bold"> Log in </span></a>here.</span>
</div>
</form>
</div>
</div>
<script src="./src/script/script.js"></script>
</body>
</html>