修正百度官方https站内搜索不能用,Google、百度、雅虎和360的站内搜索代码

  • 修正百度官方https站内搜索不能用,Google、百度、雅虎和360的站内搜索代码已关闭评论
  • 6,627 次浏览
  • A+
所属分类:WordPress主题

注意:本站启用了缓存系统,如果你的账户登陆不了,那是因为缓存导致,刷新再登陆一次即可。如还不行,只需打开任意一篇文章,然后登陆即可。本站独家汉化、原创汉化,所有发布软件均为中文,非汉化或中文软件一律不收录不发布。如果你有需要的软件下载不到,或者下载了没有汉化。可以申请本站汉化,私信本站即可,仅对本站VIP会员开放。

修正百度官方https站内搜索不能用,Google、百度、雅虎和360的站内搜索代码 由 心语家园(https://www.xinyucn.cc/)独家或原创发布,你可通过右上角“私信本站”联系我们。

本站博客使用百度站内搜索,一直搜索页面是空白,发现360等浏览器提示脚本风险,别人的站点都是好好的。研究了代码才发现,原来百度站长搜索不支持https,只能使用http,而且script脚本也是被拦截的。官方的代码不能用,怎么办呢,网上搜索了一下,代码都不能用,搞啥啊!忽然发现多年前的代码竟然能用,赶紧收藏下来,改了一下结构和风格,完美。

修正百度官方https站内搜索不能用,Google、百度、雅虎和360的站内搜索代码

对于一个网站来说,使用搜索引擎来进行站内搜索往往比自己编写的站内搜索更高效,并且不占用网站服务器的资源,下面是我搜集到的几个主要搜索引擎(Google和百度、雅虎)的站内搜索代码,使用时只需要将代码里的"xinyucn"替换成你的网址即可。

站内搜索代码:

1、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="xinyucn">

<input type=hidden name=sitesearch value="xinyucn">

</form>

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

2、百度搜索:

<!--Baidu站内搜索开始-->

<form target="_blank" action="http://zhannei.baidu.com/cse/site">

<input type="text" name="q" />

<input type="submit" value="Baidu 搜索">

<input name="ie" type="hidden" value="utf-8" />

<input name="cc" type="hidden" value="xinyucn" />

</form>

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

3、雅虎搜索;

<!--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="xinyucn">

</form>

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

4、360搜索;

<!--360站内搜索开始-->

<form target="_blank" action="https://www.so.com/s">

<input type="text" name="q" />

<input type="submit" value="360 搜索">

<input type="hidden" name="ie" value="utf-8">

<input type="hidden" name="src" value="https://www.xinyucn.cc/">

<input type="hidden" name="site" value="https://www.xinyucn.cc/">

<input type="hidden" name="rg" value="1">

<input type="hidden" name="inurl" value="">

</form>

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

下面是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=xinyucn&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=xinyucn&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站内搜索结束-->本站1元=100家园币,你可以通过签到获得家园币,用来免费捐赠。

  • 官方微信公众号
  • 扫一扫关注微信公众号,如果你觉得本站帮到了你,请通过下面的赏字按钮捐赠本站,谢谢!
  • weinxin
  • 本站官方头条号
  • 扫一扫关注官方头条号,新老用户扫描下载抖音极速版,可领取最高269元现金,每天使用都可领钱。
  • weinxin