PHP classic paging navigation function _ PHP Tutorial

Source: Internet
Author: User
PHP classic paging navigation function. PHP typical paging navigation function Source code: Copy the PHP content to the clipboard PHP code: #*************************************** * ****************** # File name: function. php # function description: News

Source code of the PHP classic paging navigation function: Copy the PHP content to the clipboard
PHP code:
#*************************************** ******************
# File name: function. php
# Function description: news addition, modification, and processing module
# Program production: print (adleyliu)
# Contact qq: 14339095
# Contact email: [email = adleyliu@163.com] adleyliu@163.com [/email]
# Official website: [url = http://www.115000.com.cn] http://www.115000.com.cn [/url]
# Copyright (c) 2007-2008 115000.com.cn all rights reserved.
# Last update:
#*************************************** ******************


#*************************************** ******************
# Paging functions
#*************************************** ******************
Function yl_list_page ($ pageurl, $ rsnum, $ pages, $ pagecount, $ pagesize ){
# Url
# Total records
# Total number of pages
# Current page number
# Number of Entries displayed per page
// $ Pageurl = ?;
$ Pcount = $ pages;
$ Page_info =

;
$ Page_info. =

;
If ($ pcount> 1) & ($ pcount = $ pagecount )){
$ Page_info. = previous page;
} Elseif ($ pagecount! = 1) & ($ pcount! = $ Pagecount )){
$ Page_info. = previous page;
}
$ Page_info. = top;
If ($ pagecount> 4 ){
$ Page_info. = [1]...;
}
If ($ pcount> $ pagecount + 2 ){
$ Endpage = $ pagecount + 2;
} Else {
$ Endpage = $ pcount;
}
For ($ n = ($ pagecount-2); $ n <= $ endpage; $ n ++ ){
If (! ($ N <1 )){
If ($ n = intval ($ pagecount )){
$ Page_info. =. $ n .;
} Else {
$ Page_info. = [. $ n.];
}
}
}
If ($ pagecount + 2 <$ pcount ){
$ Page_info. =... [. $ pcount.];
}
$ Page_info. = End of the page;
If ($ pagecount = 1) & ($ pcount! = $ Pagecount) & ($ pcount! = 0 )){
$ Page_info. = next page;
} Else if ($ pagecount! = 1) & ($ pcount! = $ Pagecount )){
$ Page_info. = next page;
}
$ Page_info. =

;
$ Page_info. =

;
$ Page_info. =

Total:. $ rsnum. entries/. $ pcount. entries on each page/. $ pagesize.

;
$ Page_info. =

;
// Echo;
$ Page_info. =

;
$ Page_info. =

;
Return $ page_info;
}

Copy the PHP content to the clipboard PHP code: #*************************************** * ****************** # File name: function. php # function description: news...

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.