前台代码:
<form action="/search" method="get" id="searchBox">
<td width="10" height="36"><input name="cate" type="hidden" value="0"></td>
<td width="160">请输入要搜索的产品信息</td>
<td><input name="keyword" type="text" id="keyword" style="width:100px;" /></td>
<td><input name="站内搜索" type="button" οnclick="querySite();" value="站内搜索" /></td>
<td><input name="百度搜索" type="button" οnclick="queryBaidu();" value="百度搜索" /></td>
<td><input name="谷歌搜索" type="button" οnclick="queryGoogle();" value="谷歌搜索" /></td>
</form>
// script实现检索功能
<body>
<script language="javascript">
function querySite(){
//document.getElementById("searchBox").action="http://www.baidu.com/s";
document.getElementById("searchBox").submit();
}
function queryBaidu(){
wd = document.getElementById("keyword").value;
//alert(wd);
location.target="blank";
location.href = "http://www.baidu.com/s?wd="+wd+"&tn=bds&cl=3&ct=2097152&si=www.pumpzc.com&s=on";
//http://www.baidu.com/s?wd=%B2%E2%CA%D4&tn=bds&cl=3&ct=2097152&si=www.pumpzc.com&s=on
}
function queryGoogle(){
wd = document.getElementById("keyword").value;
//alert(wd);
location.target="blank";
location.href = "http://www.google.com/search?domains=www.pumpzc.com&q="+wd+"&sa=%E6%90%9C%E7%B4%A2&sitesearch=www.pumpzc.com&client=pub-6854204841389277&forid=1&ie=GB2312&oe=GB2312&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1&hl=zh-CN";
//
}
</script>