note 23837 added to function.include
| From: | bradnelson at opencominc dot com | Date: | Mon, 29 Jul 2002 22:24:27 +0000 |
| Subject: | note 23837 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33903@lists.php.net to get a copy of this message | ||
Locating your include directory if you have it at the same level as your root directory (www or
htdocs or html_public etc.).
Lets say your include directory is named 'include'. Place an include file named
IncludePath.inc in your root directory with the following:
<?php
global $IncludePath;
$IncludePath = dirname($DOCUMENT_ROOT) . "/include/";
?>
Now, when you create a new page anywhere in your root directory tree type this in your page:
<?php
include($DOCUMENT_ROOT . "IncludePath.inc");
#now lets say you want to include a file called dbpassword.inc from your include directory
include($IncludePath . "dbpassword.inc");
#and so on...
?>
This helps me out so much when I'm maintaining more that one domain.
BAN
--
http://www.php.net/manual/en/function.include.php
http://master.php.net/manage/user-notes.php?action=edit+23837
http://master.php.net/manage/user-notes.php?action=delete+23837
http://master.php.net/manage/user-notes.php?action=reject+23837