google和baidu站內(nèi)搜索代碼及中文亂碼解決
時(shí)間:2023-04-24 05:27:01 | 來(lái)源:網(wǎng)站運(yùn)營(yíng)
時(shí)間:2023-04-24 05:27:01 來(lái)源:網(wǎng)站運(yùn)營(yíng)
google和baidu站內(nèi)搜索代碼及中文亂碼解決:Google和百度站內(nèi)搜索為我們網(wǎng)站提供方便的查詢功能,調(diào)用站內(nèi)搜索代碼到網(wǎng)站時(shí),可能會(huì)出現(xiàn)中文亂碼的問(wèn)題,以下是搜索代碼
<!--Google站內(nèi)搜索開(kāi)始-->
<form method=get action="
http://www.google.com/search">
<input type=text name=q>
<input type=submit name=btnG value="Google 搜索">
<input type=hidden name=ie value=GB2312>
<input type=hidden name=oe value=GB2312>
<input type=hidden name=hl value=zh-CN>
<input type=hidden name=domains value="你的網(wǎng)站地址">
<input type=hidden name=sitesearch value="你的網(wǎng)站地址">
</form>
<!--Google站內(nèi)搜索結(jié)束-->
<!--Baidu站內(nèi)搜索開(kāi)始-->
<form action="頁(yè)面不存在_百度搜索">
<input type=text name=word>
<input type="submit" value="Baidu 搜索">
<input name=tn type=hidden value="bds">
<input name=cl type=hidden value="3">
<input name=ct type=hidden value="2097152">
<input name=si type=hidden value="你的網(wǎng)站地址">
</form>
<!--Baidu站內(nèi)搜索結(jié)束-->
常見(jiàn)問(wèn)題及解決方法:
1、出現(xiàn)亂碼的解決方法:在form表單內(nèi)添加如下代碼(如果是Google的話,把代碼里的GB2312改成UTF-8就可以了)
<input type=hidden name=ie value="UTF-8">
2、搜索結(jié)果無(wú)法在新頁(yè)面顯示的解決方法:將第一行改為如下代碼
<form action="頁(yè)面不存在_百度搜索" target="_blank">