First, the scene
Today to save the list of special items found that there are more than 2,300 front-end data, but the actual server accepted into the database only 166
Ii. process of Settlement
Debugging found that the front-end page submits a POST request with the correct amount of data, but only 166 is accepted to the server.
The first thought was that the post request was longer than the limit, but looked at the request content of more than 200 k, and the POST request by default supports data transfer within 8M.
So suspicion may be caused by the internal configuration of PHP, and then Baidu was sure to find max_input_vars This configuration item, which was added after PHP 5.3.9, to prevent hash collisions .
That being the case, change the configuration item to 10000 by default, and then restart the service to find that the amount of data fetched by the server is 1666, which is 10 times times the previous one, which is exactly the multiple of the configuration item adjusted.
However, the data volume of the front-end transmission is uncertain, even if the max_input_vars set to 100,000, it may not be enough, or another way to find him.
Third, the Final Solution
1. The front end converts the array into JSON transfer, i.e. json.stringify (goodslist)
2, the server received and resolved $goodslist = Json_decode ($_post[' goodslist '), true);
3, the test found that the front end of the data service can be obtained, the problem is resolved satisfactorily
Workaround for PHP Ajax to submit post requests for array truncation