-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
65 lines (65 loc) · 2.34 KB
/
index.php
File metadata and controls
65 lines (65 loc) · 2.34 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
<?php
session_start();
?>
<!doctype html>
<html lang="en">
<head>
<title>The Coding Dojo Crimewatch</title>
<meta charset="utf-8">
<style type="text/css">
* {font-family: sans-serif;}
.center {text-align: center;}
.signup {display: inline-block; vertical-align: top; width: 480px; height: 500px; border: solid 1px black;}
.signin {display: inline-block; vertical-align: top; width: 480px; height: 500px; border: solid 1px black;}
.block {display: block;}
.index_messages {width: 460px; margin: 0px auto; height: 200px; overflow: scroll;}
.green {color: green;}
.red {color: red;}
</style>
</head>
<body>
<h1 class="center">Welcome to the Codingdojo Crime Watch!</h1>
<h3 class="center">Hide your bikes, hide your flipflops, and eat some bacon</h3>
<div class="signup">
<h2 class="center">Sign Up</h2>
<form action="process.php" method="post">
<label class="block">First Name: <input type="text" name="first_name"></label>
<label class="block">Last Name: <input type="text" name="last_name"></label>
<label class="block">Email: <input type="text" name="email"></label>
<label class="block">Password <input type="password" name="password"></label>
<label class="block">Confirm <input type="password" name="confirm_password"></label>
<input type="submit" value="Register">
<input type="hidden" name="action" value="register">
</form>
<div class="index_messages">
<?php
if(isset($_SESSION['errors'])){
echo $_SESSION['errors'];
unset($_SESSION['errors']);
}
if(isset($_SESSION['success_message'])){
echo $_SESSION['success_message'];
unset($_SESSION['success_message']);
}
?>
</div><!-- end of index_messages DIV inside signup DIV -->
</div><!-- end of signup DIV -->
<div class="signin">
<h2 class="center">Sign In</h2>
<form action="process.php" method="post">
<label class="block">Email: <input type="text" name="email"></label>
<label class="block">Password <input type="password" name="password"></label>
<input type="submit" value="Login">
<input type="hidden" name="action" value="login">
</form>
<div class="index_messages">
<?php
if(isset($_SESSION['errors_login'])){
echo $_SESSION['errors_login'];
unset($_SESSION['errors_login']);
}
?>
</div><!-- end of index_messages DIV inside signin DIV -->
</div><!-- end of signin DIV -->
</body>
</html>