//分页类
class SepPage{
 var $rs;
 var $pagesize;
 var $nowpage;
 var $array;
 var $conn;
 var $sqlstr;
 function ShowData($sqlstr,$conn,$pagesize,$nowpage){ //定义方法
  if(!isset($nowpage) || $nowpage=="")   //判断变量值是否为空
   $this->nowpage=1;      //定义每页起始页
  else
   $this->nowpage=$nowpage;
  $this->pagesize=$pagesize;     //定义每页输出的记录数
  $this->conn=$conn;       //连接数据库返回的标识
  $this->sqlstr=$sqlstr;       //执行的查询语句
  $this->rs=$this->conn->PageExecute($this->sqlstr,$this->pagesize,$this->nowpage);
  @$this->array=$this->rs->GetRows();   //获取记录数
   if(count($this->array)==0 || $this->rs==false)
    return false;
   else
    return $this->array;
 }
 function ShowPage($contentname,$utits,$anothersearchstr,$anothersearchstrs,$class){
  $allrs=$this->conn->Execute($this->sqlstr);  //执行查询语句
  $record=count($allrs->GetRows());    //统计记录总数
  $pagecount=ceil($record/$this->pagesize);  //计算共有几页
  $str.="共有".$contentname." ".$record." ".$utits." 每页显示 ".$this->pagesize." ".$utits." 第 ".$this->rs->AbsolutePage()." 页/共 ".$pagecount." 页";
  $str.="    ";
  if(!$this->rs->AtFirstPage())
   $str.="<a href=".$_SERVER['PHP_SELF']."?page=1&parameter1=".$anothersearchstr."&parameter2=".$anothersearchstrs." class=".$class.">首页</a>";
  else
   $str.="<font color='#555555'>首页</font>";
  $str.="&nbsp;";
  if(!$this->rs->AtFirstPage())
   $str.="<a href=".$_SERVER['PHP_SELF']."?page=".($this->rs->AbsolutePage()-1)."&parameter1=".$anothersearchstr."&parameter2=".$anothersearchstrs." class=".$class.">上一页</a>";
  else
   $str.="<font color='#555555'>上一页</font>";
  $str.="&nbsp;"; 
  if(!$this->rs->AtLastPage())
   $str.="<a href=".$_SERVER['PHP_SELF']."?page=".($this->rs->AbsolutePage()+1)."&parameter1=".$anothersearchstr."&parameter2=".$anothersearchstrs." class=".$class.">下一页</a>";
  else
   $str.="<font color='#555555'>下一页</font>"; 
  $str.="&nbsp;";
  if(!$this->rs->AtLastPage())
   $str.="<a href=".$_SERVER['PHP_SELF']."?page=".$pagecount."&parameter1=".$anothersearchstr."&parameter2=".$anothersearchstrs." class=".$class.">尾页</a>";
  else
   $str.="<font color='#555555'>尾页</font>";
  if(count($this->array)==0 || $this->rs==false)   
   return "";
  else
      return $str; 
 }
}

----------------------

在调用页面我们用:

 <td height="35" colspan="3" align="center" bgcolor="#FFFFFF"><?php echo $seppage->ShowPage("用户","个","参数1","参数2","a1");?></td>