note 96832 added to reserved.variables.server
| From: | piana at pyrohawk dot com | Date: | Thu, 18 Mar 2010 05:26:08 +0000 |
| Subject: | note 96832 added to reserved.variables.server | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167164@lists.php.net to get a copy of this message | ||
There are two different variables that I find very useful in Caching and similar.
$_SERVER['REQUEST_URI'] and $_SERVER['REQUEST_URL']
URI provides the entire request path (/directory/file.ext?query=string)
URL provides the request path, without the query string (/directory/file.ext)
It also differs from __FILE__ in that it's not the file name. So, if you go to
/directory/anotherfile.ext and get silently redirected to file.ext, these variables are
anotherfile.ext, while __FILE__ is still file.ext.
----
Server IP: 69.147.83.197
Probable Submitter: 70.112.152.206
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.server.php
Edit -- https://master.php.net/note/edit/96832
Del: integrated -- https://master.php.net/note/delete/96832/integrated
Del: useless -- https://master.php.net/note/delete/96832/useless
Del: bad code -- https://master.php.net/note/delete/96832/bad+code
Del: spam -- https://master.php.net/note/delete/96832/spam
Del: non-english -- https://master.php.net/note/delete/96832/non-english
Del: in docs -- https://master.php.net/note/delete/96832/in+docs
Del: other reasons-- https://master.php.net/note/delete/96832
Reject -- https://master.php.net/note/reject/96832
Search -- https://master.php.net/manage/user-notes.php