This section provides a tutorial example on how to dump information stored in the $_GET array and the $_REQUEST array.
Now try this URL, http://localhost/HttpRequestDetails.php?lang=PHP&search. You should get:
Contents of $_GET:
lang = PHP
search =
Contents of $_POST:
Contents of $_COOKIE:
Contents of $_REQUEST:
lang = PHP
search =
Contents of $_SERVER:
......
QUERY_STRING = lang=PHP&search
......
Notice that:
"?lang=PHP&search" attached at the end of the URL represents information submitted with the GET method.
"?lang=PHP&search" is parsed by the PHP engine into 2 pairs of names and values and stored in the $_GET array.
The PHP engine copied the same information from $_GET to $_REQUEST.
Exercise: Try to find a way to test how to provide information with the POST method and how to provide cookies.