|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52239 Maximum 127 form fields
Submitted: 2010-07-03 00:20 UTC Modified: 2010-07-03 00:40 UTC
From: derek at darkcolors dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: derek at darkcolors dot com
New email:
PHP Version: OS:


 [2010-07-03 00:20 UTC] derek at darkcolors dot com
If an html form contains more than 127 fields, any additional fields will not 
appear in $_POST, $_GET, $_POST, $_FILES.  Now will it appear as the actual 
variable name if register globals is on.  SUHOSIN is not turned on.  I'm sending 
the form as POST.  No error is reported anywhere.

Test script:
<form action="manage_site" method="post" enctype="multipart/form-data">
<input type="file" name="some_file[]>
<input type="file" name="some_file[]>
<input type="file" name="some_file[]>
<input type="file" name="some_file[]>
<input type="submit">

print_r($_FILES[some_file]); // Will post only info for the first 127 files.

Expected result:
PHP should accept an unlimited number of form fields and return them as the usual 
variables--or at least give a way for us to overrule this default limit of 127 

Actual result:
Only the first 127 array elements are saved form an html form POST.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-03 00:40 UTC]
-Status: Open +Status: Bogus
 [2010-07-03 00:40 UTC]
There is no such limit in PHP.  All I can think of is that your browser limits 
the number of upload fields.  I tested this in Firefox and it worked fine both 
for 1000 text fields and 1000 file upload fields.

My test case looked like this:

<form action="ff.php" method="POST">
<input type=submit>
<input type="text" name="some_file[]" value="/Users/rasmus/foo.txt">
...999 more identical lines...

And my output was:
Array ( [0] => /Users/rasmus/foo.txt [1] => /Users/rasmus/foo.txt [2] => 
/Users/rasmus/foo.txt [3] => /Users/rasmus/foo.txt [4] => /Users/rasmus/foo.txt 
[5] => /Users/rasmus/foo.txt
[995] => /Users/rasmus/foo.txt [996] => /Users/rasmus/foo.txt [997] => 
/Users/rasmus/foo.txt [998] => /Users/rasmus/foo.txt [999] => 

Since there is no 128 field limit in the code and it works perfectly for me 
against PHP 5.3.2 running on Linux as in your report, I am pretty sure this is 
not a PHP issue.  Try another browser or look for other causes.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu May 28 13:01:29 2020 UTC