note 25966 deleted from function.require-once by sniper
| From: | sniper@php.net | Date: | Wed, 29 Jan 2003 04:34:39 +0000 |
| Subject: | note 25966 deleted from function.require-once by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43008@lists.php.net to get a copy of this message | ||
As for that absolute thing, I think Windows and UNIX prase this differently. Windows will include a
absolute path from the document root but UNIX includes it from the root / . In addition to the
above post I have used a work around to this so it will always call from the document root no matter
what platform you use.
<?php $docroot = $_SERVER['DOCUMENT_ROOT']; ?>
<?php require_once("$docroot/subdir/phpfile.php"); ?>
Just set the varable $docroot to the doc root then begin the require or include with $docroot and it
will include from the document root all the time.
(I use Windows 2K Pro running Apache 2 for testing but the production server is UNIX running Apache
1.36 and this seems to work)