RE: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths..........

From: Date: Sat, 22 Feb 2003 19:42:53 +0000
Subject: RE: [PHP] Sitewide Header & Footer Includes || Trouble with Relative Paths..........
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-136663@lists.php.net to get a copy of this message
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:noah@newminddesign.com] Sent: Saturday, February 22, 2003 5:13 PM To: php-general@lists.php.net 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" <trogers@kwikin.com> wrote in message news:591280681.20030223050519@kwikin.com... > 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

« previous php.general (#136663) next »