forked from itsromack/ccs06-login-reg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
49 lines (42 loc) · 889 Bytes
/
login.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
<?php
require "config.php";
require "vendor/autoload.php";
use App\User;
// If the session variable is already set, automatically redirect the user to index page
if (isset($_SESSION['is_logged_in'])) {
if ($_SESSION['is_logged_in']) {
header('Location: index.php');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Login</title>
</head>
<body>
<h1>Login</h1>
<form action="attempt-login.php" method="POST">
<div>
<label>Email Address</label>
<input type="email" name="email" placeholder="email@address.com" />
</div>
<div>
<label>Password</label>
<input type="password" name="password" />
</div>
<div>
<button>
Login
</button>
</div>
</form>
<form action="register.php" method="GET">
<div>
<button type="submit">Register</button>
</div>
</form>
</body>
</html>