|
主题: 站内搜索
|
 qjwyn
职务:普通成员
等级:1
金币:1.0
发贴:160
注册:2001/6/13 23:16:23
|
#12001/10/13 15:13:59
我的个人网站想搞个站内搜索,就是搜索我自己的网站的内容,不包括其他网站的,用asp如何搞,谁有源文件,发给我好吗,?em:qjmail@sina.com
|
 5D荣誉斑竹
职务:普通成员
等级:2
金币:1.0
发贴:320
注册:2001/8/17 18:10:31
|
#22001/10/13 16:56:05
你如何建的数据库,告诉我,不然没办法
|
 qjwyn
职务:普通成员
等级:1
金币:1.0
发贴:160
注册:2001/6/13 23:16:23
|
#32001/10/14 14:56:25
让你见笑了,我还没有建数据库,如何办了
|
 5D荣誉斑竹
职务:普通成员
等级:2
金币:1.0
发贴:320
注册:2001/8/17 18:10:31
|
#42001/10/15 8:34:13
那就先建好数据库,然后在做了。
|
 ???
职务:普通成员
等级:2
金币:10.0
发贴:644
注册:2000/11/7 15:07:27
|
#52001/10/17 16:41:25
不需要数据库支持! 核心代码: <% SearchType = Trim(Request("SearchType")) URLRedirTo = "" strSearchString = Server.Urlencode(Trim(Request("SearchString")))
Select Case SearchType Case "local" ' first assumed is our server to be searched for URLRedirTo = Trim(Request("IDQFile")) & "?CiRestriction=" & strSearchString URLRedirTo = URLRedirTo & "&CiMaxRecordsPerPage=" & server.urlencode(Trim(Request("CiMaxRecordsPerPage"))) URLRedirTo = URLRedirTo & "&CiScope=" & server.urlencode(Trim(Request("SearchArea"))) URLRedirTo = URLRedirTo & "&TemplateName=" & server.urlencode(Trim(Request("TemplateName"))) URLRedirTo = URLRedirTo & "&CiSort=" & server.urlencode(Trim(Request("CiSort"))) URLRedirTo = URLRedirTo & "&HTMLQueryForm=" & server.urlencode(Trim(Request("HTMLQueryForm")))
Case "altavista" URLRedirTo = "http://altavista.digital.com/cgi-bin/query" & "?pg=q" URLRedirTo = URLRedirTo & "&what=web&fmt=" URLRedirTo = URLRedirTo & "&q=" & strSearchString
Case "excite" URLRedirTo = "http://www.excite.com/search.gw" URLRedirTo = URLRedirTo & "?trace=a&search=" & strSearchString & "&collection=web"
Case "infoseek" URLRedirTo = "http://www.infoseek.com/Titles" URLRedirTo = URLRedirTo & "?col=WW&qt=" & strSearchString & "&sv=IS&lk=noframes&nh=10"
Case "lycos" URLRedirTo = "http://www.lycos.com/cgi-bin/pursuit" URLRedirTo = URLRedirTo & "?cat=lycos&query=" & strSearchString
Case "hotbot" URLRedirTo = "http://www.hotbot.com/" URLRedirTo = URLRedirTo & "?SW=the+Web&SM=B&MT=" & strSearchString URLRedirTo = URLRedirTo & "&DC=10&DE=2&RG=NA&_v=2"
Case "yahoo" URLRedirTo = "http://search.yahoo.com/bin/search" URLRedirTo = URLRedirTo & "?p=" & strSearchString
Case Else End Select
if ("" <> URLRedirTo) then Response.Redirect(URLRedirTo) else %>
做一个html,调用这段代码。
编辑历史:[这消息被必胜客编辑过(编辑时间2001-10-17 16:42:14)]
|
 semon
职务:普通成员
等级:3
金币:1.0
发贴:896
注册:2000/9/15 13:43:14
|
#62001/10/18 0:50:25
要做站内搜索,首先需要你的网站支持asp等后台程序,如果你的网站是建立在数据库基础上的,那么就简单了,就是单纯的搜索数据库的关键字。如果不是的话,可以递归打开所有指定后缀的文件来做搜索,当然,效率很低的。
|