[Paging] How does one implement the page jump function? How does one implement the page jump function? For example, if there is an input box, enter any number and click the "jump to" button to jump to this page immediately. What should I do? The following is my code. all PHPcode & lt; body & gt; & lt; tablewidth = & quot; 502 & quot; border = & quot; [paging] How does one implement the page jump function?
How does one implement the page jump function?
For example, if there is an input box, enter any number and click the "jump to" button to jump to this page immediately.
What should I do? Below is my code, all posted
PHP code
Topic management |
No. |
Topic Name |
Sort |
Edit |
Delete |
// Current page number$ Page = isset ($ _ GET ['Page'])? Intval ($ _ GET ['Page']): 1;// Number of records per page$ Each_page = 5;// Query the total number of messages$ Res = mysql_query ("select count (*) FROM wyx_class ");$ Total = mysql_result ($ res, 0 );// Total number of pages$ Total_page = ceil ($ total/$ each_page );// Calculate the actual page number so that the page number always falls between 1 and 1 ~ Between $ total_page$ Page = ($ page <0 )? 1: $ page;$ Page = ($ page> $ total_page )? $ Total_page: $ page;// Calculate the offset based on the actual page number.$ Offset = ($ page-1) * $ each_page;// Last Page$ Lastpg = ceil ($ total/$ each_page );// Previous Page$ Prestart = $ page-1;// Next page$ Nextpage = $ page + 1; $ SQL = "select * from wyx_class order by wyx_classsort asc limit $ offset, $ each_page ";$ Result = mysql_query ($ SQL );While ($ Row = mysql_fetch_array ($ Result )){$ Wyx_id = $ Row ["wyx_id"];$ Wyx_classname = $ Row ["wyx_classname"];$ Wyx_classsort = $ Row ["wyx_classsort"];?>
|
|
|
Echo $ wyx_id?> "> Edit |
Echo $ wyx_id?> "> Delete |
}?>
|
If ($ page> 1 ){
// If the number of pages is greater than 1, the "previous page" button is activated.
?>
} Else {
// The button for displaying the previous page is not activated.
?>