<?php
header('Content-Type: text/html; charset=gbk');
$currentPage = $_GET["currentPage"];
if($currentPage == NULL)
{
$currentPage = 1;
}
?>
<?php
include_once("date/db.php");
$db=new db();
$sqlNew="select * from newtypecf_hz where typeid='$_GET[id]'";//echo $sqlNew;
$rs=$db->query($sqlNew);
$num=$db->rows($rs);
//echo $num;
$pageSize = 1;//
$currentRow = ($currentPage-1)*$pageSize;//
$totalpage=$num/$pageSize;
@mysql_data_seek($rs,$currentRow);//
for($i=0;$i<$pageSize && $row=$db->fetch($rs);$i++)
{
?><div class="ul2_2hd">
  <table width="835" height="884" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="841"><img src="../CMS/admin/cf_huizhang/cfimg/<?php echo $row["lv"];?>" width="851" height="841" /></td>
    </tr>
    <tr>
      <td height="43" align="center" valign="middle"><table width="755" height="28" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="475" height="28" align="left"><a href="http://<?php echo $row["weburl"];?>"><img src="im/pic_54.gif" width="129" height="28" border="0" /></a></td>
      
        </tr>
      </table></td>
    </tr>
  </table>
</div>
<?php 
}
?><table align="center">
<?php if($currentPage>1)
{
?>
<tr ><td width="83" height="23"><a href="qytest.php?currentPage=<?php echo $currentPage-1 ?>">上一页</a></td>
<?php 
}
else 
{
?>
<td width="131">上一页</td><?php 
}
?><?php if($currentPage<$totalpage)
{
?>
 <td height="23"> <a href="qytest.php?currentPage=<?php echo $currentPage+1 ?>">下一页</a></td>
<?php 
}
else
{
?>
<td>下一页   </td></tr>
<?php 
}
?></table></div>为什么当我点击下一页的时候什么值都没有 在次点击上一页的话也没有了值呢

解决方案 »

  1.   

    这个是点击挑战的代码
    <a href="cwfuz.php?id=<?php echo $row["typeid"];?>" class="STYLE26"><?php echo $row["typetitle"];?></a>
      

  2.   

    $sqlNew="select * from newtypecf_hz where typeid='[color=#FF6600]$_GET[id]'";[/color]  id的值在你点击下一页或者上一页的时候就没有传了。<a href="qytest.php?currentPage=<?php echo $currentPage+1 ?>">下一页</a><a href="qytest.php?currentPage=<?php echo $currentPage-1 ?>">上一页</a><a href="cwfuz.php?id=<?php echo $row["typeid"];?>" class="STYLE26"><?php echo $row["typetitle"];?></a>
      

  3.   

    select * from newtypecf_hz where typeid='$_GET[id]' 你的分页连接没有$_GET['id']的参数!还有最好不要这样写$_GET[id],id加上引号撒。。还有你用limit ($currentPage-1)*$pageSize, $pageSize 来取当前页数据不好吗?
      

  4.   

    $sqlNew="select * from newtypecf_hz where typeid='$_GET[id]'";
    这句中的$_GET['id']值是多少?好像没有看到有$_GET['id']值啊。
      

  5.   

    你把id给丢了 <a href="qytest.php?id=<?php echo $row["typeid"];?>&currentPage=<?php echo $currentPage+1 ?>">下一页</a>
      

  6.   

    谢谢啊
    但是又有点问题  是这样的  那个ID 有的可以得到  有的确得到不
    在一个页面里下一页的ID可以得到,但是上一页的ID就得不到了
    但是在别的页面上  不管是上一页还是下一页  都可以得到
      

  7.   

    我只是给你写了下一页,那你上一页仿照就可以了嘛<a href="qytest.php?id=<?php echo $row["typeid"];?>&currentPage=<?php echo $currentPage-1 ?>">上一页</a>
      

  8.   

    和下一页的一样对么
    <a href="qytest.php?id=<?php echo $row["typeid"];?>&currentPage=<?php echo $currentPage-1 ?>">上一页</a>
      

  9.   

    还有。。GET参数要过滤的阿。