RE: [PHP] nested includes()...
| From: | Dave Watkinson | Date: | Tue, 09 Oct 2001 10:59:14 +0000 |
| Subject: | RE: [PHP] nested includes()... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70445@lists.php.net to get a copy of this message | ||
I had something like that ... one include file for all my database
functions and another included in there for the database connection
info.
Eventually I found I had to use absolute paths (on Win2K) starting at
d:/<etc>
HTH!!
Dave
-----Original Message-----
From: Kamil Nowicki [mailto:hilarion@elfin.pl]
Sent: 09 October 2001 11:55
To: php-general@lists.php.net
Subject: Re: [PHP] nested includes()...
> I have a file x.php that includes a.inc, and a.inc includes b.inc...
>
> if I have a file dir/z.php including ../a.inc it doesn't work cuz it
won't
> find b.inc...
>
> how can I get around this???
in file dir/z.php do:
<?
chdir( ".." );
include( "a.inc" );
chdir( "dir" );
?>
This way all included files have proper current working
directory and are able to include anything else (not depending
on above 'dir' directory structure, so it's movable structure).
The only problem is that 'z.php' has to be aware that it's in 'dir'
directory.
Kamil 'Hilarion' Nowicki
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net