Skip to content

Instantly share code, notes, and snippets.

@kentr
Last active February 17, 2016 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentr/3bc24e75cb6c595b7a25 to your computer and use it in GitHub Desktop.
Save kentr/3bc24e75cb6c595b7a25 to your computer and use it in GitHub Desktop.
Request parameters test under mod_php
Resulting magic globals under mod_php from a simple POST request that also contains query parameters in the URL.
$_REQUEST contains both $_GET and $_POST. If $_GET & $_POST have the same key, the value from $_POST is used.
$_GET =>
Array
(
[qs] => qs_data
[form_text] => qs_form_text_data
)
$_POST =>
Array
(
[form_text] => form_text_data
[form_submit] => Submit
)
$_REQUEST =>
Array
(
[qs] => qs_data
[form_text] => form_text_data
[form_submit] => Submit
)
$_SERVER (partial) =>
Array
(
[REQUEST_METHOD] => POST
[QUERY_STRING] => qs=qs_data&form_text=qs_form_text_data
[REQUEST_URI] => /test-request-method.php?qs=qs_data&form_text=qs_form_text_data
[SCRIPT_NAME] => /test-request-method.php
[PHP_SELF] => /test-request-method.php
[argv] => Array
(
[0] => qs=qs_data&form_text=qs_form_text_data
)
[argc] => 1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment