-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb_admin.php
More file actions
32 lines (27 loc) · 848 Bytes
/
Copy pathweb_admin.php
File metadata and controls
32 lines (27 loc) · 848 Bytes
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
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='en'>
<head>
<meta charset='utf-8' />
<title>Log in and sign up template</title>
<link rel='stylesheet' type='text/css' href='src/css/style.css' />
<script type='text/javascript' src='src/js/app.js'></script>
</head>
<body>
<h1>Admin web page</h1>
<?php
session_start();
if (isset($_SESSION['username'])) {
if ($_SESSION['role'] === 'admin') {
echo '<p>Welcome, ' . $_SESSION['username'] . '! <a href=\'log_out.php\'>Log out</a>.</p>';
}
else {
echo '<p>You do not have permission to access this page, please log in as an administrator.</p>';
}
}
else {
echo '<p>You are not logged in. Please log in and try again.</p>';
}
?>
<a href='index.php'>Back to index.</a>
</body>
</html>