站​内​搜​索​代​码

直接粘在页面中即可使用:

 

<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.amznz.com">

<input type=hidden name=sitesearch value="www.amznz.com">

</form>

<!--Google站内搜索结束-->

 

注意:请根据自己网站编码而更改搜索代码中的编码,如:UTF-8GB2312等。

 

<!--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.amznz.com">

</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.amznz.com">

</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.amznz.com&sitesearch=www.amznz.com&q="+wq;

window.open(link); }

</script>

<input type="text" name="wq"/><input type="submit" οnclick="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.amznz.com&cl=3&ct=2097152&tn=baidulocal&word="+wd;

window.open(link); }

</script>

<input type="text" name="wd"/><input type="submit" οnclick="javascript:baidusearch()" value="Baidu 搜索" />

<!--Baidu站内搜索结束-->

 

 

 

 

 

 

 

<!--利用各种搜索引擎-->

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

<title>站内搜索</title> 

</head> 

<body> 

<script type="text/javascript" language="javascript">

    function search4() {

        if (form1.abc0.checked)

            window.open("http://search.sina.com.cn/cgi-bin/search/search.cgi?_searchkey=" + form1.key.value, "mspg0");

        if (form1.abc1.checked)

            window.open("http://site.search.sohu.com/sitesearch.jsp?page_index=0&key_word=" + form1.key.value, "mspg1");

        if (form1.abc2.checked)

            window.open("http://cn.search.yahoo.com/search?p=" + form1.key.value, "mspg2");

        if (form1.abc3.checked)

            window.open("http://www.skycn.com/search.php?sor=00&ss_name=" + form1.key.value, "mspg3");

        if (form1.abc4.checked)

            window.open("http://www.google.com/search?hl=zh-CN&inlang=zh-CN&ie=GB2312&oe=GB2312&q=" + form1.key.value, "mspg4");

        if (form1.abc5.checked)

            window.open("http://movie.baidu.com/srh.php?tn=baidux&word=" + form1.key.value, "mspg5");

        if (form1.abc6.checked)

            window.open("http://www.baidu.com/s?tn=sitehao123&word=" + form1.key.value, "mspg6");

        if (form1.abc7.checked)

            window.open("http://mp3search.baidu.com/wstsearch?tn=baidump3&ct=134217728&lm=-1&rn=&word=" + form1.key.value, "mspg7");

        if (form1.abc8.checked)

            window.open("http://search.sogua.com/search/search.asp?fmp3=1&frm=1&fwma=1&fasf=1&go.x=25&go.y=19&key=" + form1.key.value, "mspg8");

        if (form1.abc9.checked)

            window.open("http://mp3search.baidu.com/wstsearch?tn=baidump3lyric&ct=150994944&lm=-1&rn=&word=" + form1.key.value, "mspg9");

        if (form1.abc10.checked)

            window.open("http://www.baidu.com/baidu?ft=all&q1=" + form1.key.value, "mspg10");

        if (form1.abc11.checked)

            window.open("http://www.baidu.com/i?ct=201326592&cl=2&lm=-1&tn=baiduimage&word=" + form1.key.value, "mspg11");

        if (form1.abc12.checked)

            window.open("http://bingle.pku.edu.cn/scripts/ftp_search.exe?cdtype=GB&word=" + form1.key.value, "mspg12");

        if (form1.abc13.checked)

            window.open("http://mp3.baidu.com/m?rn=&tn=baidump3&ct=134217728&lm=6&word=" + form1.key.value, "mspg13");

        if (form1.abc14.checked)

            window.open("http://www.yisou.com/search?p=" + form1.key.value, "mspg14");

        if (form1.abc15.checked)

            window.open("http://news.baidu.com/ns?cl=2&rn=20&tn=news&word=" + form1.key.value, "mspg15");

        if (form1.abc16.checked)

            window.open("http://www.baidu.com/baidu?ie=gb2312&bs=&sr=&z=&ct=1048576&cl=3&f=8&word=" + form1.key.value, "mspg16");

        return false;

    }</script>

 

 <form name="form1" οnsubmit="return(search4())">

<table border="0" cellspacing=0 width=100% bordercolor=#99DF95 bgcolor=#F0F7FF cellpadding=0>

  <tr>

  <td colspan="2" align="center"><p><B><font color="#000000">关键字:</font></B><input type=text name=key size=15>

   <input type=submit style=COLOR: rgb(0,0,0); FONT-SIZE: 9pt value=搜索 name=B2>

   <input type=checkbox name="abc6" value=google checked><a href=http://www.baidu.com/>百度</a> 

    <input type=checkbox name=abc4 value=3721><a href=http://www.google.com/intl/zh-CN/>google</a>

<input type=checkbox name=abc7 value=baidump3><a href=http://mp3.baidu.com/>mp3</a> 

    <input type=checkbox name=abc9 value=baidump3>歌词     

<input type=checkbox name=abc11 value=baidump3><a href=http://image.baidu.com/>图片</a>  

    <input type=checkbox name=abc13 value=baiduflash><a href=ss/flashbaidu.htm>FLASH</a> 

<input name=abc5 type=checkbox  value=baidumovie><a href=http://movie.baidu.com/>影视</a> 

 <input type=checkbox name=abc10 value=baidufile><a href=http://file.baidu.com/>文档</a>   

 <input name=abc15 type=checkbox  value=baidunews><a href=http://news.baidu.com/>新闻</a><br>

 </p>  

</td>

</tr>

  <tr>

    <td width="220" align="right"> 

      </td>

    <td width="516"><input type=checkbox name=abc16 value=baidudict><a href=http://dict.baidu.com/>词典</a>  

<input type=checkbox name=abc8 value=baidump3><a href=http://www.sogua.com/>搜刮mp3</a>  

 <input type=checkbox name=abc2 value=yahoo><a href=http://cn.search.yahoo.com/web?&ei=UTF-8>雅虎</a> 

 <input type=checkbox name=abc3 value=yeah><a href=software.htm>软件</a> 

 <input type=checkbox name=abc12 value=baidump3><a href=http://e.pku.edu.cn/>天网搜索</a> 

<input type=checkbox name=abc14 value=baidump3><a href=http://www.yisou.com/>一搜</a>  

<input type=checkbox name=abc0 value=sina><a href=http://cha.sina.com.cn/>新浪</a>  

<input type=checkbox name=abc1 value=sohu><a href=http://dir.sogou.com/>搜狐</a></td>

  </tr>

  </table>

</form> 

</body>

</html>

<!--利用各种搜索引擎-->

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值