[请求] What is the simplest way to add "search" function in the website

  • 主题发起人 主题发起人 LaoJ
  • 开始时间 开始时间

LaoJ

知名会员
注册
2003-07-22
消息
72
荣誉分数
0
声望点数
166
Need to add the "search" function at the website, let users search something only on this website (about 10 pages)and automactically switch to the searched page. Is there any simplest way to do it (not a search engine)? thanks,
 
<form name=gs method=GET action=http://www.google.com/search>
<input type=hidden name=hl value="zh-CN">
<input type=hidden name=ie value="UTF-8">
<input type=text name=q size=41 maxlength=2048 value="site:your_site_url search_string">
<input type=submit name="btnG" value="搜索">
<input type=hidden name=lr value="true">
</form>

至于q的value里头那个site:可以用javascript来实现
只要能够构造正确的路径
Location: http://www.google.com/search?hl=zh-CN&ie=UTF-8&q=site:comefromchina.com+变态热狗&lr=

需要用到urlencode

good luck
 
最初由 ???狗 发布
<form name=gs method=GET action=http://www.google.com/search>
<input type=hidden name=hl value="zh-CN">
<input type=hidden name=ie value="UTF-8">
<input type=text name=q size=41 maxlength=2048 value="site:your_site_url search_string">
<input type=submit name="btnG" value="搜索">
<input type=hidden name=lr value="true">
</form>

至于q的value里头那个site:可以用javascript来实现
只要能够构造正确的路径
Location: http://www.google.com/search?hl=zh-CN&ie=UTF-8&q=site:comefromchina.com+变态热狗&lr=

需要用到urlencode

good luck

Thanks a lot
 
后退
顶部