1、首先在模型里,設(shè)置好搜索框的模板
2、搜索框的代碼如下:
<form action="{config:system.siteurl/}{config:system.inst/}search.php" method="get" class="search">
<input type="hidden" name="modelid" value="6"/>
<input name="query" type="text" class="search_input" />
<input type="submit" value="搜索" class="search_btn" />
</form>
其中value="6",是指模型的ID,這里必需要指定,否則會(huì)出錯(cuò),這個(gè)也是不好的地方。
27、解決內(nèi)容中包含js或者iframe等東西時(shí)提示非法數(shù)據(jù)
27、解決內(nèi)容中包含js或者iframe等東西時(shí)提示非法數(shù)據(jù)
case 21:$_is=preg_match("/(<(\/?)(script|base|iframe|style|html|body|title|link|meta|\?|\%)([^>]*?)>|(<[^>]*)\son[a-zA-Z]+\s*=([^>]*>))/isU",$post);break;
如果要加js,就把script去掉,如果要加iframe就把iframe去掉。