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

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

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