$page = empty($_GET['page'])?1:intval($_GET['page']);
    if($page<1) $page=1;
    $perpage = 1;
    $perpage = mob_perpage($perpage);
    $start = ($page-1)*$perpage;
//检查开始数 
    ckstart($start, $perpage);
if($_GET['works'])
  {
         switch($_POST["time"]){
     case 7:
   $time=time()-60*60*24*7;
   $time=">".$time;
   break;
 case 14:
   $time=time()-60*60*24*14;
   $time1=time()-60*60*24*7;$time2=time()-60*60*24*15;
   $time=" between ".$time2." and ".$time1;
   break;
 case 15:
   $time=time()-60*60*24*15;
   $time="<=".$time;
   break;
 }
     $title=array();
 if($time=="")
  {
   $time1=time()-60*60*24*7;
   $time=">".$time1;
       $zp=$_SGLOBAL['db']->query("select * from ".tname("fbcontent")." where uid='$_SGLOBAL[supe_uid]' and title!='' limit 0,6");
   $count=$_SGLOBAL['db']->result($_SGLOBAL['db']->query("select count(*) from ".tname("fbcontent")." where uid='$_SGLOBAL[supe_uid]' and title!=''"),0);echo $count;
   }
 else
  {
   $zp=$_SGLOBAL['db']->query("select * from ".tname("fbcontent")." where uid='$_SGLOBAL[supe_uid]' and title!='' and datetime$time limit $start,$perpage");
 $count=$_SGLOBAL['db']->result($_SGLOBAL['db']->query("select count(*) from ".tname("fbcontent")." where uid='$_SGLOBAL[supe_uid]' and title!='' and datetime$time limit $start,$perpage"),0);
   }
     while($zptitle=$_SGLOBAL['db']->fetch_array($zp))
   {
          $title["title"]=$zptitle["title"];
          $title["content"]=substr($zptitle["content"],0,40)."......";
          $title["datetime"]=date("Y-m-d",$zptitle["datetime"]);
  $title["id"]=$zptitle["id"];
          $title["uid"]=$zptitle["uid"];
          $title1[]=$title;
       }
}
$multi1 = multi($count, $perpage, $page, "space.php?uid=$_SGLOBAL[supe_uid]&do=share&view=article&works=work", '', 'comment_ul');
        $multi1是分页的,$_POST["time"]是下拉框的值提交过来的
请问一下,根据下拉框的值,对这个值的数据库内容进行分面。如何实现

解决方案 »

  1.   

    将平时点击的链接页数通过下拉框的select标签的value的onchange时间传递给后台就行了,其他的操作一样的
      

  2.   

    类似于
    <select id="select" onchange="page(this)">
    <option value="1">1页</option>
    <option value="2">2页</option>
    <option value="3">3页</option>
    </select><script>
    function page(select){
    location.href = "page.php?p=" + document.getElementById("select").value;
    }
    </script>
      

  3.   

    为什么我点击下一页,OPTION里的值又变成默认值了。而不是我点击分页的一页的OPTION值
      

  4.   

    你要获取你的page值
    然后和下拉框的值进行对比 如果相同就让他选中...
      

  5.   

    你可以将你到后台的select值再通过赋值方式到模板,在模板中判断$page得几就让几被选中