Home  >  Article  >  Backend Development  >  Solution to a large amount of data being lost when submitting a php form_PHP Tutorial

Solution to a large amount of data being lost when submitting a php form_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:37:09899browse

Recently, a strange phenomenon occurred in the project. There was a large form with thousands of inputs. When submitting, I always found that the posted data was incomplete. At first, I suspected that there was a conflict in the html form name. Ruled out.
Then, I searched a lot online and found that the post_max_size and upload_max_filesize of php.ini were set to very large values, but it was useless. The client_max_body_size 500m; of nginx was set to such large values, but it was useless.
Finally, Google found a solution: It turns out that PHP has added a variable max_input_vars since 5.3.9 to limit the number of submitted forms. I am really speechless.

Solution to a large amount of data being lost when submitting a php form_PHP Tutorial

This value is 1000 by default, which cannot meet the needs of more than 1000 input items, so a larger value must be added to php.ini such as:
max_input_vars = 5000
Modify After restarting apache, everything was finally normal!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/736814.htmlTechArticleRecently, a strange phenomenon occurred in the project. There was a large form with thousands of inputs. Sometimes, I always find that the data posted is incomplete. At first, I suspected it was an html table...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn