note 51699 added to function.require
| From: | -) | Date: | Thu, 07 Apr 2005 20:58:06 +0000 |
| Subject: | note 51699 added to function.require | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87679@lists.php.net to get a copy of this message | ||
If you use relativ paths in a php script (file A) that can be required by another php script (file
B), be aware that the relativ paths in file A will be relativ to the directory, where file B is
stored.
You can use the following syntax in file A, to be sure that the paths are relativ to the directory
of file A:
<?
require(dirname(__FILE__)."/path/relative/file_to_include.php");
?>
Greetings,
Richard
----
Manual Page -- http://www.php.net/manual/en/function.require.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51699
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51699&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51699&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51699&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51699&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51699&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51699&report=yes
Search -- http://master.php.net/manage/user-notes.php