jeremykendall

Untitled

Jul 11th, 2011
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.64 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Run this script with a query string in the URL and a
  5.  * specific script set in form action attribute, and
  6.  * $_GET is not populated.
  7.  *
  8.  * Run this script with a query string in the URL and
  9.  * form action unset (action=""), and $_GET is populated.
  10.  *
  11.  * This behavior might be confusing initially, but is
  12.  * not incorrect, since $_GET is populated whenever params
  13.  * appear in the url.
  14.  */
  15.  
  16. if (empty($_POST)) {
  17. ?>
  18.     <form action="" method="post">
  19.         <input type="text" name="test" />    
  20.     </form>
  21. <?php
  22. } else {
  23.     var_dump($_POST, 'POST');
  24.     var_dump($_GET, 'GET');
  25.     var_dump($_REQUEST, 'REQUEST');
  26. }
Advertisement
Add Comment
Please, Sign In to add comment