我的分页 url也正常~ 就是下面的数字不变~ 内容也不变,不知道改了~
我上传上来~~ 具体效果!!!
http://hgc888.223.idcice.net/show.php?id=1
源码:<table width="900" border="0" id="biao">
<?php
if ($page==""){
$page=1;}
if (is_numeric($page)){
$page_size=7;
$q = "SELECT count(*) as total FROM pl where plid='".$id."'order by id desc";
$rs = mysql_query($q, $dbh);
$message_count=mysql_result($rs,0,"total");
$page_count=ceil($message_count/$page_size);
$offset=($page-1)*$page_size;
$sql=mysql_query("select * from pl where plid='".$id."' order by id desc limit $offset, $page_size");
$sb=mysql_fetch_object($sql);
}
?>
<?phpwhile($sb= mysql_fetch_array($sql)){
?>
<tr bgcolor="#CCCCFF">
<td width="98">评价:</td><td width="110"><?php echo $sb[plren];?></td><td width="85">评价时间:</td>
<td width="200"><?php echo $sb[pltime];?></td>
<td width="389"><?php echo $sb[id];?>td>
</tr>
<tr>
<td>内容:</td><td colspan="3"></td>
<td colspan="2" align="center" bgcolor="#99CC99" style="font-size:12px; color:#00F;"><?php echo $sb[plcontent];?></td>
</tr>
<tr>
<td colspan="5"><hr / align="left" width="50%" size="1" color="#006600"></td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
<tr>
<td width="300"><SELECT
onchange=self.location.href=this.options[this.selectedIndex].value
name=select>
<?
for($i=1;$i<=$page_count;$i++)
{
?>
<OPTION value="show.php?id=<? echo($id);?>&&page=<? echo($i);?>" <? if($i==$page) echo(" selected") ?>>第<? echo($i);?>页</OPTION>
<?
}
?>
</SELECT></td>
</tr>
</table>
</body>
</html>
我上传上来~~ 具体效果!!!
http://hgc888.223.idcice.net/show.php?id=1
源码:<table width="900" border="0" id="biao">
<?php
if ($page==""){
$page=1;}
if (is_numeric($page)){
$page_size=7;
$q = "SELECT count(*) as total FROM pl where plid='".$id."'order by id desc";
$rs = mysql_query($q, $dbh);
$message_count=mysql_result($rs,0,"total");
$page_count=ceil($message_count/$page_size);
$offset=($page-1)*$page_size;
$sql=mysql_query("select * from pl where plid='".$id."' order by id desc limit $offset, $page_size");
$sb=mysql_fetch_object($sql);
}
?>
<?phpwhile($sb= mysql_fetch_array($sql)){
?>
<tr bgcolor="#CCCCFF">
<td width="98">评价:</td><td width="110"><?php echo $sb[plren];?></td><td width="85">评价时间:</td>
<td width="200"><?php echo $sb[pltime];?></td>
<td width="389"><?php echo $sb[id];?>td>
</tr>
<tr>
<td>内容:</td><td colspan="3"></td>
<td colspan="2" align="center" bgcolor="#99CC99" style="font-size:12px; color:#00F;"><?php echo $sb[plcontent];?></td>
</tr>
<tr>
<td colspan="5"><hr / align="left" width="50%" size="1" color="#006600"></td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
<tr>
<td width="300"><SELECT
onchange=self.location.href=this.options[this.selectedIndex].value
name=select>
<?
for($i=1;$i<=$page_count;$i++)
{
?>
<OPTION value="show.php?id=<? echo($id);?>&&page=<? echo($i);?>" <? if($i==$page) echo(" selected") ?>>第<? echo($i);?>页</OPTION>
<?
}
?>
</SELECT></td>
</tr>
</table>
</body>
</html>
$page = !empty($_GET['page']) ? intval($_GET['page']) : 1;//你可以进一步判断,保证$page >=1的整数