-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsignup.php
69 lines (64 loc) · 2.04 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
<?php
session_start();
if (isset($_SESSION['UUID']) and isset($_SESSION['username'])) {
$_SESSION['err'] = "You're Already Logged in!";
header('Location: ./index.php');
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Todo Page | Signup</title>
<link rel="stylesheet" type="text/css" href="./includes/css/main.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body class="signup">
<div class="signupBody">
<div class="center">
<h1>Signup</h1>
<h4>Todo List</h4>
<form action="./includes/signup.inc.php" method="POST">
<input type="text" class="username" name="user" placeholder="Username" required><br>
<input type="password" class="password" name="password" placeholder="Password" required><br>
<input type="password" class="password" name="passwordconf" placeholder="Password Confirmation" required><br>
<button type="submit">Sign Up</button>
</form>
</div>
</div>
<?php
$temp = $_SESSION['temp'];
$tempT = $_SESSION['tempT'];
$_SESSION['temp'] = null;
$_SESSION['tempT'] = null;
if ($tempT !== null){
echo'
<div class="modal fade" id="errModal">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">'.$tempT.'</h4>
<button type="button" class="close" data-dismiss="modal">×</button>
</div>
<div class="modal-body">
'.$temp.'
</div>
<!-- Modal footer -->
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#errModal").modal();
});
</script>
';
}
?>
</body>
</html>