http://blog.sina.com.cn/yangguangyao[订阅]
字体大小: 正文
新浪博客中加入百度搜索引擎的代码(2007-05-24 00:28:45)
 
<DIV><A href="http://blogbbs.5d6d.com/" target=_blank><FONT color=#ff0000>★博客代码★</FONT></A></DIV><!--百度搜索-->
<div align=center><iframe id="baiduframe" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0"
  framespacing="0" frameborder="0" scrolling="no" width="200" height="30"
  src=http://unstat.baidu.com/bdun.bsc?tn=dabaoku&cv=1&cid=31577&csid=102&rkcs=2&bgcr=EDEDEB&ftcr=FF0000&rk=1&bd=1&bdas=0>
</iframe></div>
 
 
 
下面是站内搜索
对于一个网站来说,使用搜索引擎来进行站内搜索往往比自己编写的站内搜索更高效,并且不占用网站服务器的资源,下面是我搜集到的几个主要搜索引擎(Google和百度、雅虎)的站内搜索代码,使用时只需要将代码里的"http://blogbbs.5d6d.com/forum-2-1.html"替换成你的网址即可。

<!--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.bkdm.cn">
<input type=hidden name=sitesearch value="www.bkdm.cn>
</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.bkdm.cn">
</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.bkdm.cn">
</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.bkdm.cn&sitesearch=hi.baidu.com/yangguangyao&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.bkdm.cn&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站内搜索结束-->
  • 评论加载中,请稍候...
发评论    明星私家相册

验证码:看不清楚数字吗?点击这里再试试。收听验证码

发评论

以上网友发言只代表其个人观点,不代表新浪网的观点或立场。

相关博文
读取中...
推荐博文
读取中...