再一次厚脸皮…………分页…………页面跳转后还是当前页面
extract($_REQUEST);
$pages=ceil($count/$list_num);
echo "
目前共有".$count."条记录 | 共".$pages."页 |
if($offset){
$preoffset=$offset-$list_num;
print "
上一页";}else {
echo "
上一页";}
$newoffset=$offset+$list_num;
if(($pages!=0)&&(($newoffset/$list_num)!=$pages))
{
print("
下一页");}
else{ echo "
下一页";}$pageno=($offset/$list_num)+1;
echo "
第页
";?>
分享到:
------解决方案--------------------
你把 61 行的 extract($_REQUEST); 调到 32 行之前,甚至可以放在 header.php 或 conn.php
否则由于 $offset 并未赋值,if(empty($offset)) 恒成立