lauthiamkok wrote:Does any one know what the idea behind using $_SERVER[] to clean the URL?
Is cleaning the URL just an idea you came across and wanted to try out, or did you have a problem that you thought cleaning the URL would solve?
I thought the the third article in your list described the process fairly well (
http://agachi.name/weblog/archives/2005 ... y-urls.htm). I didn't read all of it yet.
The idea described in that article was that you can make your site more search-engine-friendly by using URLs that look like folders:
http://example.com/real/folders/realfile.php/fake/folders/represent/variables
If you use a traditional URL, the URL for the same page looks like
http://example.com/real/folders/realfile.php?fake=folders&represent=variables
With both versions, you are passing GET variables to realfile.php.
Code: Select all
_GET => array
(
[fake] => folders
[represent] => variables
)
The PATH_INFO index of the $_SESSION array is set only when the URL has something attached to the end of it that starts with a forward-slash (/). So, of the two URLs above, only the first would populate $_SESSION['PATH_INFO'].
For that URL, the PATH_INFO would be
/fake/folders/represent/variables
Edit: This post was recovered from search engine cache.