PHP Get Parameters When Not Assigned?

Daniel

New member
Ok I've seen a few sites that do this, for instance when you click the Home link it goes to: "www.site.com/?home". How would you get the value of "home" from the url in PHP? The only way I know to do it is: "www.site.com/?page=home" I know you can use GET and POST in PHP so I'm assuming it would be GET. But the value of "home" is not assigned to something ($_GET['page'].) So how do I get the value of home from the url in PHP?
 
This returns the entire URL query string:

$_SERVER["QUERY_STRING"]

This returns all the vaules of the GET, POST, and _COOKIE globals:

$_REQUEST

I use the first one all the time, especially when I'm not sending stuff in key=value pairs. It's a nice way just to pass a parameter so you can set different options.
 
Back
Top