/
index.php
63 lines (46 loc) · 1.74 KB
/
index.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
<?php
//place this code on top of all the pages which you need to authenticate
//--- Authenticate code begins here ---
session_start();
//checks if the login session is true
if (isset($_SESSION['username'])) {
header("location:dashboard.php");
}
$username = $_SESSION['username'];
// --- Authenticate code ends here ---
?>
<?php include ('header.php'); ?>
<div class="masthead">
<h3 class="muted">NTOSS</h3>
</div>
<hr>
<div class="jumbotron">
<h1>NASA Technologist One Stop Shop</h1>
<p class="lead">All information on projects, business opportunities, suppliers, vendors and competitions related to NASA</p>
<?php $message = $_GET['message'];
if($message == 1) {
echo '
<div class="alert">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Invalid username or password</strong>
</div>
';
}
else if($message == 2) {
echo '
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>You have successfully logged out! </strong>
</div>
';
}
?>
<form action="auth_check.php" method="post" class="form-signin">
<h2 class="form-signin-heading">Please sign in</h2>
<input name="username" type="text" class="input-block-level" placeholder="Username">
<input name="password" type="password" class="input-block-level" placeholder="Password">
<button class="btn btn-large btn-primary" type="submit">Sign in</button>
</form>
<a class="btn btn-large btn-success" href="register.php">Register New User</a>
</div>
<?php include ('footer.php'); ?>