note 56258 deleted from function.include by tomsommer
| From: | tomsommer@php.net | Date: | Fri, 03 Mar 2006 10:29:40 +0000 |
| Subject: | note 56258 deleted from function.include by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-104756@lists.php.net to get a copy of this message | ||
Note Submitter: joelnation at stmarinas dot com
----
I don't know if this has been mentioned before, but it drove me insane! If you are including a
file that is in another directory to the one you are in now you must include the absoulte path to
any includes in the new file eg:
In directory A I have a file
<?php
include(../B/include.inc);
?>
In directory B I have a include.inc and include2.inc
In include.inc
<?php
// This will not work
include(include2.inc)
// This will
include(home/path/to/my/webpage/B/include2.inc);
?>
I think when you include files inside another it uses the path from the original directory, which
means you have to use the absolute path or things won't work as expected