Cannot post hidden input after update PHP 5.3.8 to

2019-06-03 07:50发布

I upgrade my PHP v5.3.8 to v5.3.24. Since updating my script no longer works.

An input variable POST it's the problem.

Form source code here : http://pastebin.com/N4XKSQjR

The line problem is the following (last line):

<input type="hidden" name="count_result" value="416">

On my PHP processing form page (traitement.php) i recover this field like this:

 $count_result = $_POST['count_result'];

And i get this php error :

Notice: Undefined index count_result on line...

The script works without problems with PHP 5.3.8 but not with PHP 5.3.24.

Can anyone help me?

Thanks

1条回答
虎瘦雄心在
2楼-- · 2019-06-03 08:35

Only solution I've been able to find, and based on the error I get while trying to duplicate the problem. Note, I tested this on PHP 5.4.x
The error:

Warning: Unknown: Input variables exceeded 1000

In my php.ini the line:

; max_input_vars = 1000

has been commented out - meaning it was defaulting to 1000. Prior to 5.3.9, this was not an option, therefore you didn't encounter the problem and it was unlimited ^^. With PHP >=5.3.9 it defaults to 1000, so to make your script compatible with so many inputs, you need to set that directive in PHP. I set it to 2000 and it worked perfectly.

Since you copied your old php.ini, it probably won't exist in there, so add:

max_input_vars = 2000

somewhere in there and it will at least work for your current example. ^^

查看更多
登录 后发表回答