|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-10-24 20:51 UTC] sniper@php.net
[2009-10-24 21:55 UTC] dgrace at wingsnw dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 19 16:00:01 2025 UTC |
Description: ------------ PHP will quietly discard variables POSTed to a form after the 1000th posted variable. This value seems to be consistent and is not affected by post_max_size. I've searched the documentation about php.ini directives and could not find anything suggesting this limit can be changed. This is especially problematic if presenting a list of items to be selected by the user (i.e. listing 1000+ items with an option to delete the selected items). The discard occurs regardless of the POST variable names -- i.e. if they are all named "id[]" to convert to an array, the failure will still happen. Tested with both IE7 and FF3.5.3 to confirm that it was not a browser limitation. Tested on Apache/2.2.13 (Debian) Reproduce code: --------------- <?php /* Test case for bug report: See how many POST variables make it back to PHP. */ error_reporting(E_ALL); $numvars = 10000; echo '<html><body>'; echo '<p>$_POST contained ', ((int) @count($_POST)), ' out of ', $numvars, ' variable(s)</p>'; echo "<form action=\"?\" method=\"post\">"; for($n = 0 ; $n < $numvars; ++$n) { echo '<input type="hidden" name="v', $n, '" value="0" />'; } echo '<input type="submit" name="submit" value="Run Test" />'; echo '</form>'; echo '</body></html>'; Expected result: ---------------- After submitting the form once, 10001 out of 10000 variables (since the submit button itself is an additional _POST variable, the count would be off in this case) Actual result: -------------- 1000 of 10000 variables