Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Run this script with a query string in the URL and a
- * specific script set in form action attribute, and
- * $_GET is not populated.
- *
- * Run this script with a query string in the URL and
- * form action unset (action=""), and $_GET is populated.
- *
- * This behavior might be confusing initially, but is
- * not incorrect, since $_GET is populated whenever params
- * appear in the url.
- */
- if (empty($_POST)) {
- ?>
- <form action="" method="post">
- <input type="text" name="test" />
- </form>
- <?php
- } else {
- var_dump($_POST, 'POST');
- var_dump($_GET, 'GET');
- var_dump($_REQUEST, 'REQUEST');
- }
Advertisement
Add Comment
Please, Sign In to add comment