vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   $PATH_INFO in 'PHP Parsed Code' in style (https://vborg.vbsupport.ru/showthread.php?t=25235)

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.


All times are GMT. The time now is 03:04 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01026 seconds
  • Memory Usage 1,702KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete