Re: Sitewide Header & Footer Includes || Trouble with Relative Paths..........
| From: | Tom Rogers | Date: | Sat, 22 Feb 2003 19:05:19 +0000 |
| Subject: | Re: Sitewide Header & Footer Includes || Trouble with Relative Paths.......... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-136654@lists.php.net to get a copy of this message | ||
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