note 56258 added to function.include
| From: | joelnationatstmarinasdotcom at osu1 dot php dot net | Date: | Sun, 28 Aug 2005 22:31:21 +0000 |
| Subject: | note 56258 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94317@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56258
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56258&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56258&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56258&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56258&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56258&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56258&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56258&report=yes
Search -- http://master.php.net/manage/user-notes.php