I'm using WAMP in my local machine, when a FORM(method="POST") with 2000 input fields is submitted I'm able to read only 1001 _POST variable. i.e With Netbeans debugger I can clearly see _POST size is always 1001 if there are more than 1001 input fields in the form.
The same is working fine in another machine(WAMP), where I can see all the POST variables.
Please help me to solve my problem.
By default, the maximum number of input variables allowed for PHP scripts is set to 1000. You can change this amount by setting the max_input_vars directive in a php. ini file. To verify the current value of the max_input_vars directive and other directives, you can use the phpinfo() function.
max_input_vars is a setting managed through the PHP setting file (php. ini) which limits the number of inputs you can set when posting forms. The Jomres Micromanage and Standard tariff editing modes allow you to have precise control over the price of each and every day in your property, for each room type.
PHP $_POST is a PHP super global variable which is used to collect form data after submitting an HTML form with method="post". $_POST is also widely used to pass variables. The example below shows a form with an input field and a submit button.
The $_POST variable is an array of variable names and values sent by the HTTP POST method. The $_POST variable is used to collect values from a form with method="post". Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send.
PHP 5.3.9 introduced the max_input_vars
config option, which is defaulted to a value of 1000. Check out the Runtime Configuration section of the PHP manual. The default value and the change log are at the top of the page.
The value can be changed by updating the server's php.ini, adding an .htaccess file, or adding a line to httpd.conf.
If you are using Suhosin with Hardened PHP, you might be hitting a maximum variables limit that it imposes. In your php.ini, you can just add
[suhosin] suhosin.request.max_vars = 1000 suhosin.post.max_vars = 1000
changing 1000
to whatever you want and restart your webserver.
I ran into this on the Drupal Permissions page when there were a lot of modules installed with a large number of roles, which resulted in a ton of checkboxes. It would only save a certain number of them before anything after would just get ignored.
It sounds like this is probably not your problem, but since it's fairly likely that someone in the future may stumble upon this when searching for something related I'll go ahead and throw this in since it took me ages to figure out when I was stumped.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With