网站实现站内站外搜索

duben4814 2011-05-26 10:37:21
写了一个网站,只实现了站内搜索,
现在需要到站内搜索不到结果或者对结果不满意是可以点个链接去google搜索或baidu搜索带关键字的结果,
这个怎么实现啊?例如用google自定义搜索呢?
...全文
277 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
回头不看 2011-05-27
  • 打赏
  • 举报
回复
HTML搜索代码,请复制下面代码到你网站需要放置搜索框的位置(注意,不是直接粘贴在页面,需要在网页代码处粘贴) 就会看到效果 参考网址:http://www.dabaoku.com/sousuo/google/index.htm


<!-- Search Google -->
<center>

<form method="get" action="http://www.google.cn/search" target="_top">

<table bgcolor="#ffffff">

<tr>
<td nowrap="nowrap" valign="top" align="left">

<table bgcolor="#ffffff">

<tr>
<td nowrap="nowrap" valign="top" align="left" height="32">

<a href="http://www.google.com/"> <img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle">
</img></a>
<label for="label" style="display: none">输入您的搜索字词</label>
<input type="text" name="q2" size="31" maxlength="255" value="" id="label">
</input>

<label for="label2" style="display: none">提交搜索表单</label>
<input type="submit" name="sa2" value="搜索" id="label2">
</input>

<input type="hidden" name="client2" value="pub-6854204841389277">
</input>

<input type="hidden" name="forid2" value="1">
</input>

<input type="hidden" name="prog2" value="aff">
</input>

<input type="hidden" name="ie2" value="GB2312">
</input>

<input type="hidden" name="oe2" value="GB2312">
</input>

<input type="hidden" name="hl2" value="zh-CN">
</input>

</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</center>
<!-- Search Google -->
卿文刚 2011-05-27
  • 打赏
  • 举报
回复
百度一下“百度源码”,你会发现。。。。
弱弱的问一句,楼主,我的头像性感吗???
wshcdr 2011-05-26
  • 打赏
  • 举报
回复
关注这个问题

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧