Emlog手机版彷佛没有赋予猎取搜刮的相干功用,横竖也是无聊状况中,本日 就给人人细致的解说一下此功用的完成要领,愿望可以帮到有须要的朋侪
起首,我们要在手机版模板的m文件夹的index.php中找到代码
$action = isset($_GET['action']) ? addslashes($_GET['action']) : '';在其下方到场代码$slkey = isset($_GET['keyword']) ? addslashes($_GET['keyword']) : '';在代码
$page_url = pagination($lognum, $index_lognum, $page, $pageurl);背面到场代码if(!empty($slkey)){//搜刮$Log_Model = new Log_Model();$page = isset($_GET['page']) ? abs(intval ($_GET['page'])) : 1;$site_title = '搜刮关键词:'.$slkey.'价格表';$pageurl = '';if(is_numeric($slkey)){$sqlSegment = "and (huohao ='{$slkey}') order by date desc";}else{$sqlSegment = "and title like '%{$slkey}%' order by date desc";}$lognum = $Log_Model->getLogNum('n', $sqlSegment);$pageurl = "./?keyword=$slkey&page=";$logs = $Log_Model->getLogsForHome($sqlSegment, $page, $index_lognum);$page_url = pagination($lognum, $index_lognum, $page, $pageurl);}挪用要领:
<form action="./" method="get" enctype="multipart/form-data" onSubmit="return slkeyword();"><input name="keyword" placeholder="输入货号或许产品名称" /><button type="submit"/>搜刮</button></form>

评论列表