Re: maddening include() problem
| From: | Cynic | Date: | Wed, 20 Dec 2000 15:29:33 +0000 |
| Subject: | Re: maddening include() problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31211@lists.php.net to get a copy of this message | ||
Say you execute a script /foo/bar/baz/script.php.
That script contains include( '../include-one.php' ) ;
(obviously its location is /foo/bar/include-one.php)
which in turn includes a file located in /foo/bar/xxx.
However, since the code from the included file
(include-one.php) becomes an integral part of 'script.php',
the path to 'include-two.php' must be either absolute
(not good, makes your app hard to use on a different
machine) or relative to the 'script.php'. I started looking
into this and have a piece of code I'd like to finish today
making this easy.
I could eventually mail it to you when I'm done.
I you'd like to see it, and if I forget to mail it to you,
drop me a note.
At 21:38 19.12. 2000, Peter Van Dijck wrote the following:
--------------------------------------------------------------
>Hi,
>Warning: Failed opening 'identifier.php' for inclusion in ../html/header.php on line 4
>
>I am trying to include a file in a file that's already being included by another file.
>I've tried
>include("text.txt");
>include("../text.txt");
>include("/public_html/htdoc/stext.txt");
>
>nothing. Is it the path??? I'm confused!
>thanks for any help,
>Peter
>
>
>--
>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
>
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz