呼叫Google和百度、雅虎進行站內搜尋程式碼
<!--Google站內搜尋開始-->
<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="www.williamlong.info">
<input type=hidden name=sitesearch value="www.williamlong.info">
</form>
<!--Google站內搜尋結束-->
<!--Baidu站內搜尋開始-->
<form action="http://www.baidu.com/baidu">
<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="www.williamlong.info">
</form>
<!--Baidu站內搜尋結束-->
<!--Yahoo站內搜尋開始-->
<form action="http://www.yahoo.com.cn/search">
<input type=text name="p">
<input type="submit" value="Yahoo 搜尋">
<input type=hidden name=vs value="www.williamlong.info">
</form>
<!--Yahoo站內搜尋結束-->
下面是Google和百度的Javascript版的站內搜尋程式碼:
<!--Google站內搜尋開始--><script type="text/javascript">
function googlesearch () {
var wq=document.getElementsByName("wq")[0].value;
var link="http://www.google.com/search?domains=www.williamlong.info&sitesearch=www.williamlong.info&q="+wq;
window.open(link); }
</script>
<input type="text" name="wq"/><input type="submit" onclick="javascript:googlesearch()" value="Google 搜尋" />
<!--Google站內搜尋結束-->
<!--Baidu站內搜尋開始-->
<script language="javascript">
function baidusearch () {
var wd=document.getElementsByName("wd")[0].value;
var link="http://www.baidu.com/s?si=www.williamlong.info&cl=3&ct=2097152&tn=baidulocal&word="+wd;
window.open(link); }
</script>
<input type="text" name="wd"/><input type="submit" onclick="javascript:baidusearch()" value="Baidu 搜尋" />
<!--Baidu站內搜尋結束-->