note 17892 added to function.include
| From: | macspert at webnautica dot net | Date: | Tue, 01 Jan 2002 03:19:03 +0000 |
| Subject: | note 17892 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-24028@lists.php.net to get a copy of this message | ||
A note about the "file_a" requiring "file_b" requiring "file_c". I
develop sites on my W2K Pro box with IIS 5, but the production server is a Linux/Apache box. IIS
doesn't seem to support $DOCUMENT_ROOT, however it does support __FILE__, cause it's a PHP
specific constant.
I found a cross-platform solution if you plan on moving your site to a new server type (specifically
W2K<->Apache). It is a slight modification of the previous postings.
When you want to require or include something, you should never get an trouble if you always type:
require_once($Dirname(__FILE__)."/"."relpath/file.php");
For the relative path you can type the full relative path ("../" and all).
Regards,
Chris
--
http://www.php.net/manual/en/function.include.php
http://master.php.net/manage/user-notes.php?action=edit+17892
http://master.php.net/manage/user-notes.php?action=delete+17892
http://master.php.net/manage/user-notes.php?action=reject+17892