php loses form POST parameters

≯℡__Kan透↙ 提交于 2019-12-24 10:59:40

问题


I have a form which sends data with the POST method, about 3000 array keys to be inserted in MySQL like this:

client_add[]=1
client_add[]=3
client_add[]=47
...

The problem is on my localhost on the development server works just fine. On production I only get about 1000 rows, on the localhot it seems to get lost, we confronted the php.ini files and the development server has everything set to more memory than my localhost.

I've run out of ideas.


回答1:


PHP has an ini setting which dictates the size of your POST request, you can probably find it in your ini under the name of post_max_size.

Also, if you've got the Suhosin patch installed it will enforce a limit on the number of POST variables you can submit on each request. I think this is around 2000 by default.




回答2:


The size of the post body will be somewhere around 50kb, which is ok as long as the server and/or PHP doesn't enforce a limit. It seems like your production environment enforces such a limit. You should check the entire webserver configuration, and if that is identical as well, compare compile-time defaults. Maybe the phpinfo() call shows more on the actual limits.



来源:https://stackoverflow.com/questions/5541362/php-loses-form-post-parameters

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