diff options
Diffstat (limited to 'web/include/thebrain.php')
-rw-r--r-- | web/include/thebrain.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/web/include/thebrain.php b/web/include/thebrain.php new file mode 100644 index 0000000..eb36a73 --- /dev/null +++ b/web/include/thebrain.php @@ -0,0 +1,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']; + +?> |