note 71638 deleted from reserved.variables by bjori
| From: | bjori@php.net | Date: | Sat, 09 Dec 2006 14:20:49 +0000 |
| Subject: | note 71638 deleted from reserved.variables by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120453@lists.php.net to get a copy of this message | ||
Note Submitter: rick dot huby at e-connected dot com
Reason: bad code
----
IIS doesn't seem to have an equivalent to $_SERVER['DOCUMENT_ROOT'] and if you try
manipulating $_SERVER['PATH_TRANSLATED'] then it won't work on APACHE (at least in my
experience).
For cross platform systems you could try including this code at the top of any pages that you will
be needing the server root path:
$server_root = str_replace( (substr($_SERVER['PHP_SELF'], 1)), "",
$_SERVER['PATH_TRANSLATED'] ); //For IIS
if ( $server_root == "" ) $server_root = $_SERVER['DOCUMENT_ROOT']; //For APACHE