=="")
$page=1;
//计算记录偏移量
$offset=$pagesize*($page-1);
//取记录
$res=
mysql_query("select username,pass,mail,add_time from buyer order by add_time limit $offset,$pagesize" ,$db);
//循环显示记录
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">序号</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">添加时间</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>" ;
}
//显示总页数
echo "<div align='center'>共有".$pages."页(".$page."/".$pages.")<br>";
//显示分页数
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>";
//显示转到页数
echo "<form action='$SELF_PHP' method='post'> ";
//计算首页、上一页、下一页、尾页的页数值
$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]
文章评论
共有 位脚本之家网友发表了评论我来说两句