欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php簡單的分頁程序

 更新時(shí)間:2008年03月30日 01:05:20   作者:  
php 分頁 簡單
=="") 
  $page=1; 

   
//計(jì)算記錄偏移量 
$offset=$pagesize*($page-1); 
//取記錄 
$res=mysql_query("select username,pass,mail,add_time from buyer order by add_time limit $offset,$pagesize" ,$db); 
//循環(huán)顯示記錄 
  if ($myrow = mysql_fetch_array($res)) 
  { 
   $i=0; 
?> 
</p> 
<p>  </p> 
<table width="100%" border="0" align="center"> 
  <tr> 
    <td width="40%" height="30"> </td> 
    <td width="20%" align="center"><span class="STYLE1">用戶信息管理<br> 
          <br> 
    </span></td> 
    <td width="15%"> </td> 
    <td><? $time=date ("Y-l-F H:i:s");echo $time;?> 
       </td> 
  </tr> 
</table> 
<div align="center"> 
  ------------------------------------------------------------- 
</div> 
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0"> 
  <tr> 
    <td width="10%" height="24" bgcolor="#cccccc"><div align="center">序號(hào)</div></td> 
    <td width="20%" bgcolor="#cccccc"><div align="center">用戶名</div></td> 
    <td width="20%" bgcolor="#cccccc"><div align="center">密碼</div></td> 
    <td width="30%" bgcolor="#cccccc"><div align="center">電子郵箱</div></td> 
    <td bgcolor="#cccccc"><div align="center">添加時(shí)間</div></td> 
  </tr> 
  <?php 
do  

  $i++; 
?> 
  <tr> 
    <td width="10%"><div align="center"><?php echo $i;?></div></td> 
    <td><div align="center"><font size="2"> <?php echo $myrow['username'];?></font></div></td> 
    <td><div align="center"><font size="2"><?php echo $myrow['pass'];?></font></div></td> 
    <td><div align="center"><font size="2"><?php echo $myrow['mail'];?></font></div></td> 
    <td><div align="center"><font size="2"><?php echo $myrow['add_time'];?></font></div></td> 
  </tr> 

  <?php 

while ($myrow = mysql_fetch_array($res)); 
  echo "</table>" ; 

//顯示總頁數(shù) 
echo "<div align='center'>共有".$pages."頁(".$page."/".$pages.")<br>"; 
//顯示分頁數(shù) 
for ($i=1;$i<$page;$i++) 
  echo "<a href='$SELF_PHP?page=".$i."'>第".$i ."頁</a>  "; 
  echo "第".$page."頁  "; 
for ($i=$page+1;$i<=$pages;$i++) 
  echo "<a href='$SELF_PHP?page=".$i."'>第".$i ."頁</a>  "; 
  echo "<br>"; 
//顯示轉(zhuǎn)到頁數(shù) 
  echo "<form action='$SELF_PHP' method='post'> "; 
//計(jì)算首頁、上一頁、下一頁、尾頁的頁數(shù)值 
$first=1; 
$prev=$page-1; 
$next=$page+1; 
$last=$pages; 
if ($page>1) 

  echo "<a href='$SELF_PHP?page=".$first."'>首頁</a>  "; 
  echo "<a href='$SELF_PHP?page=".$prev."'>上一頁</a>  "; 

if ($page<$pages) 

  echo "<a href='$SELF_PHP?page=".$next."'>下一頁</a>  "; 
  echo "<a href='$SELF_PHP?page=".$last."'>尾頁</a>  "; 

echo "</form>"; 
echo "</div>"; 
?> 
</table> 
<p> </p> 
</body> 
</html> 
[/code]

相關(guān)文章

最新評(píng)論