|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-02 14:35 UTC] oregon at pobox dot com
When both GET and POST variables are sent at the same time to the same array, the GET variables are not getting set correctly (with register_globals=on and track_vars=on). Example: <form action="bug?person[age]=12" method=post> <input type=text size=32 name=person[sname] </form> With register_globals=on and track_vars=on, the script should get both $person['age'] and $person['sname'], and this worked properly in earlier versions of PHP (at least up to 4.2.3). But as of 4.3.1, the POST variable is getting set but the GET variable is lost. This is causing properly written scripts to break under new versions of PHP. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 14:00:01 2025 UTC |
Here's a bit more extended version of the test script, including cookies too: <?php setcookie("person[fname]", "foobar"); ?> <form action="bug23454.php?person[age]=27" method=post> <input type=text size=32 name="person[sname]"> <input type=submit> </form> <pre> <?php echo phpversion(); echo '<br>register_globals = ', ini_get('register_globals'), '<br>'; print "_GET: "; print_r($_GET); print "_POST: "; print_r($_POST); print "_COOKIE: "; print_r($_COOKIE); print "_REQUEST: "; print_r($_REQUEST); print "person: "; print_r($person); ?> </pre>Expected results: _GET: Array ( [person] => Array ( [age] => 27 ) ) _POST: Array ( [person] => Array ( [sname] => bar ) ) _COOKIE: Array ( [person] => Array ( [fname] => foo ) ) _REQUEST: Array ( [person] => Array ( [age] => 27 [fname] => foo [sname] => bar ) ) person: Array ( [age] => 27 [fname] => foo [sname] => bar ) (the last two are broken since 4.3.0 and only contain "fname" entry)