aboutsummaryrefslogtreecommitdiffstats
path: root/web/include/thebrain.php
blob: eb36a73c0cf53ccbdc4cc046083d1c69dd1cb8a9 (plain)
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
<?php
$navlist = array(
 "home" => "Home",
 "instruc" => "Instructions",
 "status" => "Status"
);

function include_safe($file) {
	if (strpos(realpath("include/$file"), realpath($_SERVER['DOCUMENT_ROOT'])) !== 0) {
		$code = 403;
		require("errors.php");
	}
	elseif (file_exists("include/$file")) {
		include($file);
	}
	else {
		$code = 404;
		require("errors.php");
	}
}

if (!$_GET['page']) {
	$page = "home";
}
else {
	$page = $_GET['page'];

?>