This article mainly introduces ThinkPHP's method of keeping pages in the search state. For more information, see automatically adding, deleting, modifying, and querying the base class, the search status of the result page should be maintained during paging, but the solution in the thinkphp manual cannot work.
The solution in the ThinkPHP manual is:
// Make sure that the query conditions are foreach ($ map as $ key => $ val) {$ Page-> parameter. = "$ key = ". urlencode ($ val ). &;}
It cannot be used directly. After debugging, you will find that when $ map is not an array, the variable cannot get the desired value, the official idea is to traverse the encapsulated search condition $ map, which is better than directly traversing the data submitted by the form. Therefore, the code above can be changed:
// Make sure that the query conditions are foreach ($ _ GET as $ key => $ val) {// echo $ key. $ val; $ page-> parameter. = "$ key = ". urlencode ($ val ). &;}
Solve the problem. of course, if your form is submitted by POST, just traverse POST.