ThinkPHP allows you to maintain the search status by page. For many users who use the ThinkPHP framework, the query base class should be added, deleted, modified, and deleted automatically, and the search status of the result page should be maintained during paging, however, the solution in the thinkphp manual is used by many people who use the ThinkPHP framework to add, delete, modify, and query the base class automatically. The search status of the result page should be maintained during paging, however, 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.
...