Home > Backend Development > PHP Tutorial > php翻页代码出错,(只剩最后的27分了)

php翻页代码出错,(只剩最后的27分了)

WBOY
Release: 2016-06-13 12:45:03
Original
978 people have browsed it

php翻页代码出错,请教高手。(只剩最后的27分了)
运行结果是只显示数据库内容的第一页,单击“下一页”仍然停留在第一页上。

<?php<br />
	$pages=ceil($count/$list_num);<br />
    echo "<table width=780 border=0 cellspacing=0 cellpadding=0 align=center class='text'><br />
          <tbody> <br />
          <tr> <td width='159'><font color='#ff0000'>目前共有".$count."条记录</font> </td><br />
               <td width='205'>共".$pages."页</td>";<br />
	  if($offset){<br />
		 $preoffset=$offset-$list_num;<br />
	print "<td width='132'><a href=\"$PHP_SELF?offset=$preoffset\">上一页</a></td>";}<br />
	  else {<br />
	echo  "<td width='132'>上一页</td>";<br />
	}<br />
	 $newoffset=$offset+$list_num;<br />
	  if(($pages!=0)&&(($newoffset/$list_num)!=$pages))<br />
	{<br />
	 print("<td width='158'><a  href=\"$PHP_SELF?offset=$newoffset\">下一页</a></td>");<br />
	}<br />
	  else{ echo "<td width='158'>下一页</td>";}<br />
	 $pageno=($offset/$list_num)+1;<br />
	echo "<td width='112' class=text>第<input class=text type='text' size='4'value=".$pageno." readonly>页</td><br />
          <td width='4'> </td> </tr> </table>";<br />
   ?>
Copy after login

php?翻页 PHP 翻页
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template