-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
54 lines (49 loc) · 1.81 KB
/
index.php
File metadata and controls
54 lines (49 loc) · 1.81 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
<?php
session_start();
include 'scripts/auth-class.php';
include_once 'scripts/page-class.php';
$auth = new Auth();
$home = new Page("main.php");
// If logged in, go to the main page
if($auth->isLoggedIn())
{
$home->redirect();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DoorKnocker Signin</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/signin.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<form class="form-signin" role="form" action='scripts/login.php' method='post'>
<h2 class="form-signin-heading">Please sign in</h2>
<?php
// Display error message if login has failed
if(isset($_SESSION['fail_login']) && $_SESSION['fail_login'] == TRUE)
{
unset($_SESSION['fail_login']);
echo('<h5>Sorry, Invalid Login Credentials</h5>');
}
?>
<input name="username" type="text" class="form-control" placeholder="Username" required autofocus>
<input name="password" type="password" class="form-control" placeholder="Password" required>
<button class="btn btn-lg btn-danger btn-block" type="submit">Log In</button>
</form>
<form class="form-signup">
<a href="signup.php" class="btn btn-lg btn-primary btn-block">Sign Up</a>
</form>
</div>
</body>
</html>