forked from barun511/thor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.php
78 lines (78 loc) · 2.7 KB
/
register.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
<?php
session_start();
if(isset($_SESSION['user']))
{
header("Location: index.php");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Thor · Register</title>
<link rel="stylesheet" href="css/nav.css">
<link rel="stylesheet" href="css/loginregister.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script>
$(document).ready(function(){
var showPassword = $("#showPassword");
showPassword.click(function(){
if(showPassword.is(":checked")){
$("#password").attr("type","text");
}
else{
$("#password").attr("type","password");
}
});
});
</script>
</head>
<body>
<nav>
<h1 class="title">
Thor
</h1>
<div class="links">
<a href="index.php">Rank List</a>
<a href="problems.php">Problems</a>
<?php
if(isset($_SESSION["user"])){
echo '<a href="submit-code.php"><span>Submit Code</span></a>';
echo '<a href="javascript:void(0);"><span>'.$_SESSION["user"].'</span></a>';
echo '<a href="logout.php"><span>Logout</span></a>';
}
else{
echo '<a href="login.php"><span>Login</span></a>';
echo '<a href="register.php"><span>Register</span></a>';
}
?>
</div>
</nav>
<section class="section1">
<h1>Register</h1>
<form method="POST" action="api/check.php">
Name<br><input type="text" placeholder="Name" name="name" autocomplete="off"><br>
User ID<br><input type="text" placeholder="Unique Username" name="userID" autocomplete="off"><br>
Password<br><input id="password" type="password" name="userPassword" autocomplete="off" placeholder="Password"><span style="font-size: 0.8em;display: block;">Show Password <input type="checkbox" id="showPassword"></span><br>
<input type="submit" name="submitregister" style="margin-top: 0px;">
</form>
<p class="result">
<?php
if($_GET["success"]=="incomplete"){
echo "Incomplete details.";
}
else if($_GET["success"]=="exists"){
echo "Username exists. Try another one.";
}
else if($_GET["success"]=="true"){
echo "Successfully registered!";
}
else{
echo "";
}
?>
</p>
</section>
</body>
</html>