-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
48 lines (35 loc) · 971 Bytes
/
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
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
/**********************************************
Software Engineering Group Project
Computer Science and Information Systems Year 3
**********************************************/
session_start();
if( isset($_SESSION['login']) && isset($_SESSION['admin']))
{
header('Location: ./admin.php');
}
?>
<!DOCTYPE html>
<?php
include 'res/config/headder.php'; //loads the logo and the nav bar
?>
<div id="maincontent"> <!-- define whatever gets loaded here as "mainconnent"-->
<?php
//parse URL to load content
if(isset($_GET['page'])) {
if(file_exists('res/pages/'.$_GET['page'].'.php')) {
include('res/pages/'.$_GET['page'].'.php');
} else {
include 'res/pages/error.php';
}
} else {
include('res/pages/start.php');
}
?>
</div>
<?php
include 'res/config/footer.php'; //loads the footer file
?>
</html>