note 46349 deleted from reserved.variables by aidan
| From: | aidan@php.net | Date: | Fri, 08 Oct 2004 07:27:21 +0000 |
| Subject: | note 46349 deleted from reserved.variables by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78169@lists.php.net to get a copy of this message | ||
Note Submitter: medelibero[at no spam]gmail.com
----
/*
* This function is to compensate for CGI based PHP applications in windows
* not having DOCUMENT_ROOT within the server global array.
* It takes the element value of SCRIPT_FILENAME and removes the ORIG_SCRIPT_NAME value
*/
function getDocumentRoot() {
$sTmp = $_SERVER['ORIG_SCRIPT_NAME'];
$sDocRoot = $_SERVER['SCRIPT_FILENAME'];
// change the "/" to "\"
$sTmp = str_replace("/", "\\", $sTmp);
// remove the entry now
$sDocRoot = str_replace($sTmp, "", $sDocRoot);
return $sDocRoot;
}