-全站搜索
'翱翔designz.cn制作
call websearch()%>
a=request("search")
b=request("key")
if b"" then
if a="搜索动态" then
call snews()
elseif a="搜索图片" then
call sworks()
elseif a="搜索会员" then
call suser()
elseif a="搜索下载" then
call sdown()
elseif a="搜索文摘" then
call sbook()
end if
else
response.Write "本搜索引擎可以搜索站内各栏目中的相关内容;使用方法如下:第一步:输入要搜索的栏目。第二步:输入要搜索的方式。第三步:输入要搜索的关键词。然后点击提交即可快速搜索到本站相关资讯。 "
end if%>
response.write "全站搜索--"&a&""
dim rs,sql
set rs=server.CreateObject("Adodb.recordSet")
sql="select * from news where title like '%"&b&"%' order by id desc"
rs.open sql,cn,2,1
while not(rs.eof or rs.bof)
response.write(" "&rs("title")&" 发布日期: "&rs("date")&"")
rs.movenext
wend
rs.close
set rs=nothing
end sub
sub sworks()
response.write "全站搜索--"&a&""
dim rs,sql
set rs=server.CreateObject("Adodb.recordSet")
sql="select * from pic where title like '%"&b&"%' order by id desc"
rs.open sql,cn,2,1
while not(rs.eof or rs.bof)
response.write(" "&rs("title")&" 发布日期: "&rs("date")&"")
rs.movenext
wend
rs.close
set rs=nothing
end sub
sub suser()
response.write "全站搜索--"&a&""
dim rs,sql
set rs=server.CreateObject("Adodb.recordSet")
sql="select * from ax_user where name like '%"&b&"%' order by id desc"
rs.open sql,cn,2,1
response.write ""
while not(rs.eof or rs.bof)
response.write ""
response.write(" "&rs("name")&" 性别:"&rs("sex")&"QQ号:"&rs("userqq")&"注册日期: "&rs("regtime")&"")
response.write ""
rs.movenext
wend
response.write ""
rs.close
set rs=nothing
end sub
sub sdown()
response.write "全站搜索--"&a&""
dim rs,sql
set rs=server.CreateObject("Adodb.recordSet")
sql="select * from down where title like '%"&b&"%' order by id desc"
rs.open sql,cn,2,1
while not(rs.eof or rs.bof)
response.write(" "&rs("title")&" 发布日期: "&rs("date")&"")
rs.movenext
wend
rs.close
set rs=nothing
end sub
sub sbook()
response.write "全站搜索--"&a&""
dim rs,sql
set rs=server.CreateObject("Adodb.recordSet")
sql="select * from book where title like '%"&b&"%' order by id desc"
rs.open sql,cn,2,1
while not(rs.eof or rs.bof)
response.write(" "&rs("title")&" 发布日期: "&rs("date")&"")
rs.movenext
wend
rs.close
set rs=nothing
end sub
%>