note 12333 rejected from ref.http by philip
| From: | philip@php.net | Date: | Thu, 12 Dec 2002 23:07:20 +0000 |
| Subject: | note 12333 rejected from ref.http by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40819@lists.php.net to get a copy of this message | ||
Since IIS does not support the $DOCUMENT_ROOT env var, here is a quick fix to grab it yourself.
// string get_web_root()
// returns path to the web document root.
function get_web_root () {
global $PATH_TRANSLATED;
global $PATH_INFO;
return substr($PATH_TRANSLATED, 0 , -strlen( $PATH_INFO )+1);
}
This works even with a query string tagged onto the URL, and will give the same results from
anywhere inside the doc root.