search
Homephp教程PHP源码Php经典分页源码

<script>ec(2);</script>

#*********************************************************
#文件名称: function.php
#功能描述: 新闻添加修改处理模块
#程序制作:留印(adleyliu)
#联系qq  :14339095
#联系邮箱:[email=adleyliu@163.com]adleyliu@163.com[/email]
#官方网站: [url=http://www.115000.com.cn]http://www.115000.com.cn[/url]
#copyright (c) 2007-2008 115000.com.cn all rights reserved.
#最后更新:     2007-11-20
#*********************************************************


#*********************************************************
#分页函数
#*********************************************************
function yl_list_page($pageurl,$rsnum,$pages,$pagecount,$pagesize
){
#url
#总记录
#总页数
#当前页码
#每页显示数
   //$pageurl='?';
   
$pcount $pages
;
   
$page_info '

';
   
$page_info .= '
'
   if ((
$pcount 1) && ($pcount == $pagecount
) ){
       
$page_info .= '.$pageurl.'page='.intval($pagecount-1).'>上一页'
;
   }elseif ((
$pagecount != 1) && ($pcount != $pagecount
)){
      
$page_info .= '.$pageurl.'page='.intval($pagecount-1).'>上一页'
;
   }
      
$page_info .= '.$pageurl.'page=1>页首'
;
   if (
$pagecount 4
){
     
$page_info .= '.$pageurl.'page=1>[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 .= '.$pageurl.'page='.$n.'>['.$n.']'
;
     }
      }
   }
   if (
$pagecount+$pcount
){
       
$page_info .= '....$pageurl.'page='.$pcount.'>['.$pcount.']'
;
   }
       
$page_info .= '.$pageurl.'page='.$pcount.'>页尾'
;
   if ((
$pagecount == 1) && ($pcount != $pagecount) && ($pcount != 0
)){
       
$page_info .= '.$pageurl.'page='.intval($pagecount 1).'>下一页'
;
   }else if ((
$pagecount != 1) && ($pcount != $pagecount
)){
       
$page_info .= '.$pageurl.'page='.intval($pagecount 1).'>下一页'
;
   }
       
$page_info .= '
';
   
$page_info .= '
';
   
$page_info .= '
 共:'.$rsnum .'条/'.$pcount.'页 每页/'.$pagesize.'条
'
;
   
$page_info .= 
';
   
//echo '
';
   
$page_info .= ' 转到'
;
   
$page_info .= ''
;
   
$page_info .= '页 '
;
   
//echo '';
   
$page_info .= '
'
;
   
$page_info .= '
'
;
      return 
$page_info
;
}

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.