Fixed two bugs that show up with some PHP configurations:

* Use of undefined constant MENU_FILE - assumed 'MENU_FILE' (added quotes)
 * Cannot modify header information - headers already sent (extra newlines
   at the end of menu.php)
(ugha)
This commit is contained in:
ugha
2004-07-23 05:03:34 +00:00
committed by zzz
parent aca253dade
commit b1aa766b22
2 changed files with 5 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
<?php
include('menu.php');
define(MENU_FILE,'menu.ini');
define(PAGE_DIR,'pages/');
define(PAGE_EXT,'.html');
define('MENU_FILE','menu.ini');
define('PAGE_DIR','pages/');
define('PAGE_EXT','.html');
/* Filter out everything except alphanumerical characters and underscores */
function form_filter($data) {
@@ -24,7 +24,7 @@ if(is_readable(PAGE_DIR.$page.PAGE_EXT)) {
include(PAGE_DIR.$page.PAGE_EXT);
include(PAGE_DIR.'footer'.PAGE_EXT);
} else {
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
include(PAGE_DIR.'header'.PAGE_EXT);
print "<h1>Error: Page \"$page\" not found</h1>";
include(PAGE_DIR.'footer'.PAGE_EXT);

View File

@@ -49,4 +49,3 @@ function buildmenu() {
}
}
?>