Log in

View Full Version : time for yet another stupid question


amykhar
11-26-2001, 08:13 PM
I am working on a page that uses a template. The script has a series of ob_get_contents(); and ob_cleans() in which it imports other scripts.

My problem is that if more than one of these scripts imports global.php, things blow up. But, if I remove the global.php call from all but one of them, things don't work.

How can I include more than one script that itself includes global.php?

Amy

amykhar
11-27-2001, 11:19 AM
bumping out of mild desperation. :D

Amy

Admin
11-27-2001, 11:51 AM
In these scripts, instead of just doing:
require('./global.php');
use this:
if (!function_exists("getpostbit")) {
include('./global.php');
}

This will include global.php only if it's not already included (we check by finding out if a function called getpostbit() is defined already).

amykhar
11-27-2001, 11:52 AM
Thank you. You're a doll. :)

Amy

Hooper
11-27-2001, 05:20 PM
Yup. I had the same problem trying to get a clock and other scripts included. I had to find away around the problem also. Includes can be tricky. ;)