-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
158 lines (145 loc) · 6.45 KB
/
signup.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign Up</title>
<link rel="preload" href="./images/signup.jpg" as="image">
<style>
html,body{
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
body{
/* background: grey; */
vertical-align: middle;
background-image: url('./images/signup.jpg');
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
}
p{
font-size: 13;
font-weight: bolder;
color: yellow;
font-family: sans-serif;
}
</style>
</head>
<body class="flex flex-col items-center justify-center">
<section>
<form class="w-full max-w-sm" action = "includes/signup.inc.php" method = "post">
<div class="md:flex md:items-center mb-6">
<div class="md:w-1/3">
<label class="block text-white font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-full-name">
Full Name
</label>
</div>
<div class="md:w-2/3">
<input class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
id="inline-full-name" name="name" type="text" placeholder="Enter Your Name">
</div>
</div>
<div class="md:flex md:items-center mb-6">
<div class="md:w-1/3">
<label class="block text-white font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-full-name">
Email
</label>
</div>
<div class="md:w-2/3">
<input class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
id="inline-full-name" name="email" type="text" placeholder="Enter an Email">
</div>
</div>
<div class="md:flex md:items-center mb-6">
<div class="md:w-1/3">
<label class="block text-white font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-full-name">
Username
</label>
</div>
<div class="md:w-2/3">
<input class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
id="inline-full-name" name="uid" type="text" placeholder="Enter a Username">
</div>
</div>
<div class="md:flex md:items-center mb-6">
<div class="md:w-1/3">
<label class="block text-white font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-password">
Password
</label>
</div>
<div class="md:w-2/3">
<input class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
id="inline-password" name="pwd" type="password" placeholder="******************">
</div>
</div>
<div class="md:flex md:items-center mb-6">
<div class="md:w-1/3">
<label class="block text-white font-bold md:text-right mb-1 md:mb-0 pr-4" for="inline-password">
Confirm Password
</label>
</div>
<div class="md:w-2/3">
<input class="bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-purple-500"
id="inline-password" name="pwdrepeat" type="password" placeholder="******************">
</div>
</div>
<div class="md:flex md:items-center">
<div class="md:w-1/3"></div>
<div class="md:w-2/3">
<button class="shadow bg-purple-500 hover:bg-purple-400 focus:shadow-outline focus:outline-none text-white font-bold py-2 px-4 rounded"
name="submit" type="submit">
Sign Up
</button>
</div>
</div>
</form>
</section>
<br>
<?php
// _POST : Checking for Data we can't see inside the URL,
// _GET : Checking for Data that we can see inside the URL.
if(isset($_GET["error"]))
{
if ($_GET["error"] == "Empty_Input") {
# code...
echo "<p> Kindly Fill all the Fields </p>";
}
else if ($_GET["error"] == "Invalid_UserName_ID") {
# code...
echo "<p> Kindly Enter Valid UserName </p>";
}
else if ($_GET["error"] == "InvalidEmail") {
# code...
echo "<p> Kindly Enter Valid Email </p>";
}
else if ($_GET["error"] == "Invalid_Password_Doesn't_Match") {
# code...
echo "<p> Password Doesn't Match </p>";
}
else if ($_GET["error"] == "UserName_Already_Taken") {
# code...
echo "<p> Sorry, UserName Already Exists </p>";
}
else if ($_GET["error"] == "Statement_Failed") {
# code...
echo "<p> Sorry, Something Went Wrong ! </p>";
}
else if ($_GET["error"] == "None") {
# code...
echo "<p> Congratulations, You have Signed Up Successfully :) </p>";
}
}
?>
<br>
<div>
<a href="./index.php">
<button class="bg-gray-300 hover:bg-gray-400 text-gray-800 font-bold py-4 px-4 rounded-full shadow-lg">
Return to HomePage </button>
</a>
</div>
<script src="https://cdn.tailwindcss.com"></script>
</body>
</html>