Example #1
0
//排序
$orderby = RepPostVar($_POST['orderby']);
$myorder = (int) $_POST['myorder'];
if ($orderby) {
    $orderr = ReturnDoOrderF($tempr[modid], $orderby, $myorder);
    $orderby = $orderr['returnf'];
} else {
    $orderby = 'newstime';
}
//是否有历史记录
if ($searchid) {
    $search_num = $empire->gettotal($query);
    $sql = $empire->query("update {$dbtbpre}enewssearch set searchtime='{$searchtime}',result_num='{$search_num}',onclick=onclick+1,orderby='{$orderby}',myorder='{$myorder}',tempid='{$s_tempid}' where searchid='{$searchid}'");
    if (empty($search_num)) {
        $searchid = 0;
    }
} else {
    $search_num = $empire->gettotal($query);
    if (empty($search_num)) {
        $searchid = 0;
    } else {
        $iskey = $keyboardone == 1 ? 0 : 1;
        $sql = $empire->query("insert into {$dbtbpre}enewssearch(searchtime,keyboard,searchclass,result_num,searchip,classid,onclick,orderby,myorder,checkpass,tbname,tempid,iskey,andsql,trueclassid) values('{$searchtime}','{$keyboard}','{$newsearchclass}','{$search_num}','{$ip}','{$classid}',1,'{$orderby}','{$myorder}','{$checkpass}','{$tbname}','{$s_tempid}','{$iskey}','{$andsql}','{$trueclassid}')");
        $searchid = $empire->lastid();
    }
}
//设置最后搜索时间
$set1 = esetcookie("lastsearchtime", $searchtime, $searchtime + 3600 * 24);
db_close();
$empire = null;
Header("Location:result/?searchid={$searchid}" . $dogetvar);