PHP pages to achieve the data submitted in the form POST, non-GET, solve the right problem only display the first page

// data paging implement PHP after POST form submission, non-GET, using SESSION, paged code section is not described in detail, the main problem is displayed in addition to the first page after the POST 
// The following is the ACTION page content, only cases when the page is not judged to pOST submit, after the finish to do, to write the SQL statement SESSION 

$ SQL = "the SELECT * from the user"; // non pOST antecedents, the default display all the user 
iF ( $ _SERVER [ 'REQUEST_METHOD'] == 'the POST' ) {
     $ the userName = $ _POST [ 'the userName' ];
     $ Mobile = $ _POST [ 'Mobile' ];
     $ SQL = "SELECT * WHERE InStr from User (the userName, '{ $ the userName } ')> 0 and InStr (Mobile,' { $ Mobile } ')> 0 Order by desc Time " ;
    $_SESSION['live_sql'] = SQL $ ; // cache POST query, the focus! 
}
 // If the SESSION exists POST continues to output the result, the other does not exist. . 
SQL $ = $ _SESSION [ 'live_sql'] ?? $ SQL ;

 

Guess you like

Origin www.cnblogs.com/tmdsleep/p/10955454.html