-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
68 lines (63 loc) · 2.88 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
<?php
require('inc/config.php');
include_once('inc/header.php');
?>
<section class="signup-form">
<h2>Sign Up</h2>
<form action="signup.inc.php" method="post">
<input type="text" name="fname" placeholder="First Name..." required><br>
<input type="text" name="lname" placeholder="Last Name..." required><br>
<input type="text" name="email" placeholder="Email..." required><br>
<input type="text" name="uid" placeholder="Username..." required><br>
<input type="password" name="pwd" placeholder="Password..."><br>
<input type="password" name="pwdrepeat" placeholder="Repeat Password..."><br>
What's your skating style?
<select name='style' id='style'>
<option></option>
<option value='street'>Street</option>
<option value='vert'>Vert</option>
<option value='downhill'>Downhill</option>
<option value='freeride'>Freeride</option>
<option value='dancing'>Dancing</option>
</select><br>
How would you describe your skating level?
<select name='lvl' id='lvl'>
<option></option>
<option value='beginner'>Beginner</option>
<option value='intermediate'>Intermediate</option>
<option value='advanced'>Advanced</option>
<option value='sensei'>Sensei</option>
<option value='god'>God</option>
</select><br>
<input type='text' name='bio' id='bio' placeholder="Write something about yourself.."><br><br>
<button type="submit" name="submit">Sign Up</button>
</form>
<?php
if(isset($_GET["error"])){ //outputing error messages to the user
if($_GET["error"] == "emptyInput"){
echo "<p>One of the fields was empty, please try again.</p>";
}
else if($_GET["error"] == "invalidUid"){
echo "<p>Please choose a proper username.</p>";
}
else if($_GET["error"] == "invalidEmail"){
echo "<p>Please use a proper email</p>";
}
else if($_GET["error"] == "passwordsDontMatch"){
echo "<p>Unfortunately your passwords didn't match, please try again.</p>";
}
else if($_GET["error"] == "usernameTaken"){
echo "<p>Unfortunately your username OR email address was already used, please try again.</p>";
}
else if($_GET["error"] == "stmtFailed"){
echo "<p>Unfortunately something went wrong, please try again.</p>";
}
else if($_GET["error"] == "none"){
echo "<p>You have signed up successfully.</p>";
}
}
?>
</section>
<?php
include_once('inc/footer.php');
?>