This repository was archived by the owner on Nov 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhomepage.php
More file actions
38 lines (31 loc) · 1.35 KB
/
Copy pathhomepage.php
File metadata and controls
38 lines (31 loc) · 1.35 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
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><?php echo $_SESSION['Username']; ?>'s Homepage</title>
</head>
<body>
Logged in as: <?php echo $_SESSION['Username'];
//This gets the username from the session cookie?> | <a href="logout.php">Log out</a> |
<a href="homepage.php">Homepage</a>
<?php if (isset($_SESSION['Admin'])) {
echo "| <a href=\"adminconsole.php\">Admin Console</a>";
} //Checks if Admin. if you are, adds link to console?> <br>
<?php if (isset($_GET['submission']) == 1) echo "You have successfully submitted a ticket"; ?>
<form method="post">
<p>
<input type="button" onclick="location.href='Incident.php';" value="Submit Incident"/>
<?php if (isset($_SESSION['Admin'])) {
echo "<input type=\"button\" onclick=\"location.href='adminconsole.php';\" value=\"Admin Console\"/>";
} //Checks if Admin. if you are, adds button to console?>
<input type="button" onclick="location.href='logout.php';" value="Logout"/>
<?php if (isset($_GET['Submission']) == 1) echo "Submission Entered"; ?>
</p>
</form>
</body>
</html>
<?php
if (!isset($_SESSION['Username'])) {
header('Location:restricted.php');
}