JakeG
08-13-2001, 07:06 AM
NOTE: PROBLEM SOLVED; PATH_INFO variable wasn't available on the server, although it was on my development machine. Switched to PHP_SELF instead
I'm trying to make a new style for my site which is consistent with the rest of the site through the use of a header.php file located in the root directory.
On my site, different HTML is displayed at the top of the page depending what part of the site you're in. So, for the fourms this'll include things like links to 'register', 'user CP' etc., whilst in another part of the site it'll include different HTML.
The forums are located in a directory "/f". Other parts of the site are in different directories.
I'm using the following code in header.php to see if someone's in the forums part of the site:
if (ereg("/f/", $GLOBALS["PATH_INFO"])) $site_section = 5;
I'm including the header.php file through the 'PHP parsed code' part of the style's setting:
// This code is PHP4 only:
ob_start();
require("$DOCUMENT_ROOT/header.php");
$header = ob_get_contents();
ob_end_clean();
It's not working! I'm not getting any errors, it's just not setting $site_section to 5.
Any help? Perhaps it's something todo with ob_start() function.
I'm trying to make a new style for my site which is consistent with the rest of the site through the use of a header.php file located in the root directory.
On my site, different HTML is displayed at the top of the page depending what part of the site you're in. So, for the fourms this'll include things like links to 'register', 'user CP' etc., whilst in another part of the site it'll include different HTML.
The forums are located in a directory "/f". Other parts of the site are in different directories.
I'm using the following code in header.php to see if someone's in the forums part of the site:
if (ereg("/f/", $GLOBALS["PATH_INFO"])) $site_section = 5;
I'm including the header.php file through the 'PHP parsed code' part of the style's setting:
// This code is PHP4 only:
ob_start();
require("$DOCUMENT_ROOT/header.php");
$header = ob_get_contents();
ob_end_clean();
It's not working! I'm not getting any errors, it's just not setting $site_section to 5.
Any help? Perhaps it's something todo with ob_start() function.