Repository navigation
Expand file tree
/
Copy pathsignup.php
More file actions
235 lines (211 loc) · 6.22 KB
/
Copy pathsignup.php
File metadata and controls
235 lines (211 loc) · 6.22 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
<?php
@include 'config.php';
if (isset($_POST['submit'])) {
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$pass = $_POST['password'];
$cpass = $_POST['cpassword'];
$select = " SELECT * FROM user_form WHERE email = '$email' && password = '$pass' ";
$result = mysqli_query($conn, $select);
if (mysqli_num_rows($result) > 0) {
$error[] = 'user already exist!';
} else {
if ($pass != $cpass) {
$error[] = 'password not matched!';
} else {
$insert = "INSERT INTO user_form(name, email, password) VALUES('$name','$email','$pass')";
mysqli_query($conn, $insert);
header('location:login.php');
}
}
};
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Sign Up to EduZone</title>
<link rel="shortcut icon" href="images/favicon.png" type="image/x-icon">
<style>
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans:wght@700&family=Poppins:wght@400;500;600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body {
margin: 0;
padding: 0;
background: linear-gradient(120deg, white, #b435ff);
height: 100vh;
overflow: hidden;
}
.center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 400px;
background: #b435ff;
border-radius: 10px;
box-shadow: 10px 10px 15px rgba(0, 0, 0, 0.05);
}
.center img {
margin-left: 40%;
margin-bottom: -8%;
}
.center h1 {
color: white;
text-align: center;
padding: 20px 0;
border-bottom: 1px solid whitesmoke;
}
.center h5 {
color: white;
text-align: center;
padding: 20px 0;
border-top: 1px solid whitesmoke;
}
a {
text-decoration: none;
color: whitesmoke;
letter-spacing: 1px;
}
.center form {
padding: 0 40px;
box-sizing: border-box;
}
form .txt_field {
position: relative;
border-bottom: 2px solid whitesmoke;
margin: 30px 0;
}
.txt_field input {
width: 100%;
padding: 0 5px;
height: 40px;
font-size: 16px;
border: none;
background: none;
outline: none;
}
.txt_field label {
position: absolute;
top: 50%;
left: 5px;
color: whitesmoke;
transform: translateY(-50%);
font-size: 16px;
pointer-events: none;
transition: 0.5s;
}
.txt_field span::before {
position: absolute;
top: 40px;
left: 0;
width: 0%;
height: 2px;
background: #2691d9;
transition: 0.5s;
}
.txt_field input:focus~label,
.txt_field input:valid~label {
top: -5px;
color: #2691d9;
}
.txt_field input:focus~span::before,
.txt_field input:valid~span::before {
width: 100%;
}
input[type="submit"] {
width: 100%;
height: 50px;
border: 1px solid;
background: #2691d9;
border-radius: 25px;
font-size: 18px;
color: #e9f4fb;
font-weight: 700;
cursor: pointer;
outline: none;
box-shadow: 1px 1px 24px 0px purple;
}
input[type="submit"]:hover {
transition: 0.5s;
background-color: whitesmoke;
box-shadow: 2px 2px 26px 2px white;
color: purple;
}
.signup_link {
margin: 30px 0;
text-align: center;
font-size: 16px;
color: whitesmoke;
}
.signup_link a {
color: violet;
text-decoration: none;
}
.signup_link a:hover {
color: white;
transition: 0.3s;
}
.center .error-msg {
margin: 10px 0;
display: block;
background: gold;
color: crimson;
border-radius: 5px;
font-size: 20px;
padding: 10px;
box-shadow: 2px 2px 26px 2px red;
}
</style>
</head>
<body>
<div class="center">
<a href="index.html">
<img src="images/favicon.png" alt="" width="20%"></a>
<h1>Sign-Up</h1>
<?php
if (isset($error)) {
foreach ($error as $error) {
echo '<span class="error-msg">' . $error . '</span>';
};
};
?>
<form method="post">
<div class="txt_field">
<input type="text" name="name" required>
<span></span>
<label>Name</label>
</div>
<div class="txt_field">
<input type="text" name="email" required>
<span></span>
<label>E-mail</label>
</div>
<div class="txt_field">
<input type="password" name="password" required>
<span></span>
<label>Password</label>
</div>
<div class="txt_field">
<input type="password" name="cpassword" required>
<span></span>
<label>Confirm Password</label>
</div>
<input type="submit" value="Sign-Up" name="submit">
<div class="signup_link">
Already a Member! <a href="login.php">Login</a>
</div>
</form>
<h5><a href="index.html">
Powered by EduZone
</a></h5>
</div>
</body>
</html>