-
Notifications
You must be signed in to change notification settings - Fork 152
/
Copy pathsignup.php
228 lines (194 loc) · 11.8 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
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
<?php
session_start();
define('TITLE',"Signup | KLiK");
if(isset($_SESSION['userId']))
{
header("Location: index.php");
exit();
}
include 'includes/HTML-head.php';
?>
</head>
<body>
<div id="signup">
<div class="container">
<div class="row">
<div class="col-sm-6 offset-sm-1">
<div class="signup-left position-fixed text-center">
<img src="img/200.png">
<br><br><br>
<?php
if(isset($_GET['error']))
{
if($_GET['error'] == 'emptyfields')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Fill In All The Fields
</div>';
}
else if ($_GET['error'] == 'invalidmailuid')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Please enter a valid email and user name
</div>';
}
else if ($_GET['error'] == 'invalidmail')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Please enter a valid email
</div>';
}
else if ($_GET['error'] == 'invaliduid')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Please enter a valid user name
</div>';
}
else if ($_GET['error'] == 'passwordcheck')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Passwords donot match
</div>';
}
else if ($_GET['error'] == 'usertaken')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> This User name is already taken
</div>';
}
else if ($_GET['error'] == 'invalidimagetype')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Invalid image type
</div>';
}
else if ($_GET['error'] == 'imguploaderror')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Image upload error, please try again
</div>';
}
else if ($_GET['error'] == 'imgsizeexceeded')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Error: </strong> Image too large
</div>';
}
else if ($_GET['error'] == 'sqlerror')
{
echo '<div class="alert alert-danger" role="alert">
<strong>Website Error: </strong> Contact admin to have the issue fixed
</div>';
}
}
else if (isset($_GET['signup']) == 'success')
{
echo '<div class="alert alert-success" role="alert">
<strong>Signup Successful</strong> Please Login from the login menu
</div>';
}
?>
<form id="signup-form" action="includes/signup.inc.php" method='post'
enctype="multipart/form-data">
<input type="submit" class="btn btn-light btn-lg" name="signup-submit" value="Signup">
<br><br>
<a href="login.php">
<i class="fa fa-sign-in fa-2x social-icon" aria-hidden="true"></i>
</a>
<a href="contact.php">
<i class="fa fa-envelope fa-2x social-icon" aria-hidden="true"></i>
</a>
</div>
</div>
<div class="col-sm-6 offset-sm-6 text-center">
<h1 class="mt-5 text-muted">Signup and Lets Go!</h1>
<br><br><br>
<div class="form-row">
<div class="form-group col-md-6">
<label for="name">Username</label>
<input type="text" class="form-control" id="name" name="uid" placeholder="Username" maxlength="25">
</div>
<div class="form-group col-md-6">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" name="mail" placeholder="Email">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="pwd">Password</label>
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="Password">
</div>
<div class="form-group col-md-6">
<label for="pwd-repeat">Confirmation</label>
<input type="password" class="form-control" id="pwd-repeat" name="pwd-repeat"
placeholder="Repeat Password">
</div>
</div>
<div class="form-row border-top my-3">
<div class="form-group col-md-12">
<h2>Optional</h2>
</div>
</div>
<div class="form-row ">
<div class="form-group col-md-6">
<label for="f-name">First Name</label>
<input type="text" class="form-control" id="f-name" name="f-name" placeholder="First name" maxlength="35">
</div>
<div class="form-group col-md-6">
<label for="l-name">Last Name</label>
<input type="text" class="form-control" id="l-name" name="l-name" placeholder="Last name" maxlength="35">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6 align-self-center">
<label >Gender</label><br>
<input id="toggle-on" class="toggle toggle-left" name="gender" value="m" type="radio" checked>
<label for="toggle-on" class="btn-r">M</label>
<input id="toggle-off" class="toggle toggle-right" name="gender" value="f" type="radio">
<label for="toggle-off" class="btn-r">F</label>
</div>
<div class="form-group col-md-6 align-self-center">
<img id="blah" class="rounded" src="#" alt="your image" class="img-responsive rounded"
style="height: 200px; width: 190px; object-fit: cover;">
<br><br><label class="btn btn-primary ">
Set Avatar <input type="file" id="imgInp" name='dp' hidden>
</label>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-12">
<label for="headline">Headline</label>
<input type="text" class="form-control" id="headline" name="headline"
placeholder="Your profile headline"
maxlength="120">
</div>
</div>
<div class="form-group">
<label for="bio">Bio</label>
<textarea class="form-control" id="bio" name="bio" rows="6" maxlength="1000"
placeholder="Tell people about yourself"></textarea>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js" ></script>
<script>
$('#blah').attr('src', 'uploads/default.png');
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#imgInp").change(function() {
readURL(this);
});
</script>
</body>
</html>