|
< ><?php <BR>if(!$whichpage) <BR>{ <BR>$notepage=1; <BR>} <BR>else <BR>{ <BR>$notepage=$whichpage; <BR>} <BR>$noterecs=0; <BR>$pagesize=10; <BR>$bbsconn=mysql_connect("localhost","root"); <BR>mysql_select_db("rainwindy",$bbsconn); <BR>$bbsresult=mysql_query("select * from bbs order by id desc",$bbsconn); <BR>$rsnum=mysql_num_rows($bbsresult); <BR>$pagecount=ceil($rsnum/$pagesize); <BR>mysql_data_seek($bbsresult,($notepage-1)*10); <BR>?> <BR><div align=right> <BR><BR><table border="0" width="730" cellspacing="0" cellpadding="0"> <BR> <tr> <BR> <td width="41" height="30" bgcolor="#C0C0C0" bordercolor="#0000FF" valign="middle" align="center">编号</td> <BR> <td width="100" height="30" bordercolor="#0000FF" bgcolor="#C0C0C0" valign="middle" align="center">用户名</td> <BR> <td width="100" height="30" bordercolor="#0000FF" bgcolor="#C0C0C0" valign="middle" align="center">发表人</td> <BR> <td width="311" height="30" bordercolor="#0000FF" bgcolor="#C0C0C0" valign="middle" align="center">文章标题</td> <BR> <td width="239" height="30" bordercolor="#0000FF" bgcolor="#C0C0C0" valign="middle" align="center">发表时间</td> <BR> </tr> <BR><?php <BR>while(($bbsrow=mysql_fetch_array($bbsresult)) && ($noterecs<=9)) <BR>{ <BR><BR>?> <BR><tr> <BR> <td width="41" height="30" bgcolor="#FFFFCC" valign="middle" align="center"><?php echo $bbsrow["id"] ?></td> <BR> <td width="100" height="30" bgcolor="#FFFFCC" valign="middle" align="center"><?php echo $bbsrow["usr"] ?></td> <BR> <td width="100" height="30" bgcolor="#FFFFCC" valign="middle" align="center"><?php echo $bbsrow["name"] ?></td> <BR> <td width="311" height="30" bgcolor="#FFFFCC" valign="middle" align="center"><a href="bbsdisp.php?whichnote=<?php echo $bbsrow["id"] ?>" target="disp"><?php echo $bbsrow["title"] ?></a></td> <BR> <td width="239" height="30" bgcolor="#FFFFCC" valign="middle" align="center"><?php echo $bbsrow["bbstime"] ?></td> <BR> <BR></tr> <BR><?php <BR>$noterecs=$noterecs+1; <BR>} <BR>?> <BR></table> <BR><BR></div> <BR><br> <BR><br> <BR><center> <BR><?php <BR>$pad=0; <BR>for($counter=1;$counter<=$pagecount;$counter++) <BR>{ <BR>if($counter>=10) <BR>{ <BR>$pad=""; <BR>} <BR><BR>echo("<font size=+1 color=red><a href='bbsbl.php?whichpage=$counter'>".$pad.$counter."</a></font>&nbsp;&nbsp;"); <BR>} <BR>?> </P> |
|