Cannot post hidden input after update PHP 5.3.8 to PHP 5.3.24

ⅰ亾dé卋堺 提交于 2019-12-08 04:51:11

问题


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:


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. ^^



来源:https://stackoverflow.com/questions/16165713/cannot-post-hidden-input-after-update-php-5-3-8-to-php-5-3-24

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!