From: "Samuel Ventura" <[EMAIL PROTECTED]>

> I have 3 files in nested subdirectories
>
> (1) /test.php
> (2) /subdir1/test.php
> (3) /subdir1/subdir2/test.php
>
> if I call (3) it loops forever in (2) trying to
> including itself.
>
> Is this a bug or a feature?

A feature?

You make a request for (3). The thing to remember/realize is that now all
require(), include(), etc. calls now happen relative to the path of (3). So,
when you include (2), which tries to include ../test.php, it is trying to
include itself again because the include() happens relative to the path of
(3).

include()'s are almost like a cut and paste. If you took the code from (2)
and pasted it into (3) in place of the include(), that's the end result.

This is why I do not use relative paths.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to