ID:               22865
 Updated by:       [EMAIL PROTECTED]
 Reported By:      josmith at albertc dot on dot ca
-Status:           Open
+Status:           Bogus
 Bug Type:         *General Issues
 Operating System: WinNT 5 and Linux
 PHP Version:      4.3.1
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Relative paths in include/require are always relative to the initial
script, *not* to the file doing the include-ing.  Thus:

  - when file1 is called directly, the relative path for include-ing
file2 is indeed ../folder2/file2

  - when the original call is to index.php, which includes file1, which
includes file2, the relative path to file 2 is ./folder2/file2
(relative to index.php, *not* file1), even from within file1.

You will need to use some kind of tracking of the base path for the
current invocation.


Previous Comments:
------------------------------------------------------------------------

[2003-03-24 22:28:59] josmith at albertc dot on dot ca

ok... 
index.php
    folder1
        file1
    folder2
        file2

That is the dir structure.

file1 'include()'s file2 and file1 is included in index. When file1 is
called directly from the browser it includes file2 (by using include
"../folder2/file2"). However, when file1 is included in index.php the
path to file to (located in file1) must be absolute, it cannot be
relative (although when fil1 is called directly the path to file2 can
be relative). Using any relative path does nto appear to work in this
rare case.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=22865&edit=1

Reply via email to