[Paging] How does one implement the page jump function? Solution

Source: Internet
Author: User
[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
  




















































// 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"];?> }?>
Topic management
No. Topic Name Sort Edit Delete
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.
?>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.