I have a table with 113 rows in it. Every row have 9 cells, where is an input in it, like on this shema:
row_1[td_1],row_1[td_2],[...],
row_2[td_1],row_2[td_2],[...],
row_3[td_1],row_3[td_2],[...]
[...]
row_113[td_1],row_113[td_2],[...]
The problem: when I'm sending this data via POST, I'm only getting data up to the first field of row_112:
[...]
["row_111"]=>
array(9) {
["tytul"]=>
string(15) "example element"
["pkwiu"]=>
string(0) ""
["jm"]=>
string(1) "2"
["ilosc"]=>
string(1) "1"
["cena_brutto"]=>
string(5) "74.00"
["vat"]=>
string(3) "23%"
["vat_oryginalny"]=>
string(2) "23"
["cena_netto"]=>
string(5) "60.16"
["wartosc_brutto"]=>
string(5) "74.00"
}
["row_112"]=>
array(1) {
["tytul"]=>
string(15) "example element" <------
}
Why am I not receiving the full form data?
The example is avaiable here: http://pastebin.com/ahVqUetJ
On top of script I've just put simply:
<?php
if(isset($_POST) && count($_POST) > 0) {
var_dump($_POST);
exit;
}
?>
That is because from PHP 5.3.9 they added a limit for max_input_vars, and that limit is 1000.
From your form with 111 rows you get 111*9=999 + 1 (1 from row_112) resulting 1000 variables.
Change in php.ini:
max_input_vars = 3000
suhosin.post.max_vars = 3000
suhosin.request.max_vars = 3000
suhosin.get.max_vars = 3000
or from php:
ini_set('max_input_vars', 3000);
or any limit you want.
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