note 102734 added to reserved.variables.server
| From: | Jamie at osu1 dot php dot net | Date: | Wed, 02 Mar 2011 21:18:44 +0000 |
| Subject: | note 102734 added to reserved.variables.server | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-177508@lists.php.net to get a copy of this message | ||
Note that on real paths, aliases are not resolved
$_SERVER["DOCUMENT_ROOT"] => /var/services/web/mysite
$_SERVER["SCRIPT_FILENAME"] => /var/services/web/mysite/admin/products.php
(but __FILE__ => /volume1/web/mysite/admin/inc/includeFile.inc.php)
Use realpath to resolve the $_SERVER value.
Virtual paths also have some differences:
$_SERVER["SCRIPT_NAME"] => /admin/products.php (virtual path)
$_SERVER["PHP_SELF"] => /admin/products.php/someExtraStuff (virtual path)
SCRIPT_NAME is defined in the CGI 1.1 specification, PHP_SELF is created by PHP itself. See http://php.about.com/od/learnphp/qt/_SERVER_PHP.htm
for tests.
----
Server IP: 69.147.83.197
Probable Submitter: 195.137.106.159
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.server.php
Edit -- https://master.php.net/note/edit/102734
Del: integrated -- https://master.php.net/note/delete/102734/integrated
Del: useless -- https://master.php.net/note/delete/102734/useless
Del: bad code -- https://master.php.net/note/delete/102734/bad+code
Del: spam -- https://master.php.net/note/delete/102734/spam
Del: non-english -- https://master.php.net/note/delete/102734/non-english
Del: in docs -- https://master.php.net/note/delete/102734/in+docs
Del: other reasons-- https://master.php.net/note/delete/102734
Reject -- https://master.php.net/note/reject/102734
Search -- https://master.php.net/manage/user-notes.php