phpcms 如何做搜索功能,需要详细的代码?
若以下回答无法解决问题,邀请你更新回答
1个回答
展开全部
<form name="search_form1" target="_blank" onsubmit="return go(this)">
<input
name="q" id="q" size="30" value="请输入关键字" onMouseOver="this.focus()"
onBlur="if (value ==''){value='请输入关键字'}" onFocus="this.select()"
onClick="if(this.value=='请输入关键字')this.value=''">
<INPUT name="word" type="hidden" value=0>
<INPUT name="myselectvalue" type="hidden" value=0>
<INPUT name="tn" type="hidden" value="sayyes">
<INPUT name="cl" type="hidden" value="3">
<input type="hidden" name="m" value="search"/>
<input type="hidden" name="c" value="index"/>
<input type="hidden" name="a" value="init"/>
<input type="hidden" name="typeid" value="1"/>
<input type="hidden" name="siteid" value="1"/>
<INPUT CHECKED name="myselect" onclick=javascript:this.form.myselectvalue.value=0; type=radio value=0>
<FONT color=#0000cc style="FONT-SIZE: 12px">互联网</FONT>
<INPUT name="myselect" onclick=javascript:this.form.myselectvalue.value=1; type=radio value=1>
<FONT color=#ff0000 style="FONT-SIZE: 12px">站内</FONT>
<input type="submit" value="搜索">
</form>
<SCRIPT language=javascript>
<!--
function go(formname)
{
var url = "http://www.baidu.com/baidu";
formname.method = "get";
if (formname.myselectvalue.value == "1") {
url="{APP_PATH}index.php";
}
document.search_form1.word.value = document.search_form1.q.value;
formname.action = url;
return true;
}
//-->
</SCRIPT>
<input
name="q" id="q" size="30" value="请输入关键字" onMouseOver="this.focus()"
onBlur="if (value ==''){value='请输入关键字'}" onFocus="this.select()"
onClick="if(this.value=='请输入关键字')this.value=''">
<INPUT name="word" type="hidden" value=0>
<INPUT name="myselectvalue" type="hidden" value=0>
<INPUT name="tn" type="hidden" value="sayyes">
<INPUT name="cl" type="hidden" value="3">
<input type="hidden" name="m" value="search"/>
<input type="hidden" name="c" value="index"/>
<input type="hidden" name="a" value="init"/>
<input type="hidden" name="typeid" value="1"/>
<input type="hidden" name="siteid" value="1"/>
<INPUT CHECKED name="myselect" onclick=javascript:this.form.myselectvalue.value=0; type=radio value=0>
<FONT color=#0000cc style="FONT-SIZE: 12px">互联网</FONT>
<INPUT name="myselect" onclick=javascript:this.form.myselectvalue.value=1; type=radio value=1>
<FONT color=#ff0000 style="FONT-SIZE: 12px">站内</FONT>
<input type="submit" value="搜索">
</form>
<SCRIPT language=javascript>
<!--
function go(formname)
{
var url = "http://www.baidu.com/baidu";
formname.method = "get";
if (formname.myselectvalue.value == "1") {
url="{APP_PATH}index.php";
}
document.search_form1.word.value = document.search_form1.q.value;
formname.action = url;
return true;
}
//-->
</SCRIPT>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询