Re: does chdir() change include_path on the fly? HELP
| From: | Ignacio Vazquez-Abrams | Date: | Fri, 19 Jan 2001 21:41:52 +0000 |
| Subject: | Re: does chdir() change include_path on the fly? HELP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35735@lists.php.net to get a copy of this message | ||
On Fri, 19 Jan 2001, Noah Spitzer-Williams wrote:
> my problem is i have an include file in a parent directory which includes
> other files. i want these other files to be in the same directory as this
> parent directory file..(hope your gettin me here...). the prob is the parent
> directory file looks for its include files in the current directory.
>
> example:
> current path is:
> www.blah.com/blahdir
>
> a file in blahdir called blah1.php includes blah2.php which is located in
> www.blah.com
> blah2.php includes blah3.php and blah4.php which are also located in
> www.blah.com
> the problem is blah2.php looks for blah3.php and blah4.php in
> www.blah.com/blahdir
>
> will chdir() fix this? or is there another way?
>
> Thanks!!
>
> - Noah
>
Two solutions come to mind:
1) Use a variable to store the directory you want to include from.
2) Use absolute paths.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>