$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"]是下拉框的值提交过来的
请问一下,根据下拉框的值,对这个值的数据库内容进行分面。如何实现
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"]是下拉框的值提交过来的
请问一下,根据下拉框的值,对这个值的数据库内容进行分面。如何实现
<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>
然后和下拉框的值进行对比 如果相同就让他选中...