I do the following and it seems to work OK: I put the following two lines at the top of each script: $defsPath = "[my include path]defs/"; include_once($defsPath."globals.php3");
...and later a call to a function I wrote ( printNavLinks() ) that outputs whatever I want in the header/footer. The function is defined in another include file included by globals.php3. -----Original Message----- From: CF High [mailto:[EMAIL PROTECTED] Sent: Saturday, February 22, 2003 5:13 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths.......... Hey Tom. Thanks for the idea; however, since we're not hosting the site on our own server, we don't have permissions for altering the php.ini file.......... --Noah "Tom Rogers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > Sunday, February 23, 2003, 6:14:32 AM, you wrote: > CH> Hey All. > > CH> Got a perhaps easy question here: > > CH> How can I create a global header and footer include to my site pages where I > CH> don't rely on absolute paths to include and image files? > > CH> I'm having trouble including my header and footer .inc's within a > CH> multi-level directory structure -- the relative paths to images (and to > CH> includes within includes) are not currently accessed within the current > CH> directory structure. > > CH> I'm assuming I'll need to prepend all image and include files with a path > CH> variable that I set within each page, or something along those lines? > > CH> Any help much appreciated, > > CH> --Confused > > CH> -- > > I do this at the top of my scripts > > ini_set ("include_path",'path/to/inc/dir:'.ini_get("include_path")); > > that way you just do include('file.inc') from anywhere and it will find your > files. > > -- > regards, > Tom > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php