<%@ LANGUAGE=VBScript CodePage=65001%> <% response.charset="utf-8" %> <% session.codepage=65001 %> <% search_q=request.querystring("q") %> 搜索:<%=search_q%>_宏发化工回收公司 <% keywords=split(search_q," ") c=ubound(keywords) for i=0 to c if i=0 then search_sql1=search_sql1&"where ( [title] like '%"&keywords(i)&"%'" keywords_all=keywords(i) else search_sql1=search_sql1&" or [title] like '%"&keywords(i)&"%'" keywords_all=keywords_all&"+"&keywords(i) end if next s_sql="select [title],[content],[file_path],[time],ArticleType from [article] "&search_sql1&" ) and view_yes=1 order by [time] desc" %>
联系我们   Contact
你的位置:首页 > 搜索
<% if search_q<>"" then set rs=server.createobject("adodb.recordset") rs.open(s_sql),cn,1,1 %> <%'=============分页定义开始,要放在数据库打开之后 if err.number<>0 then '错误处理 response.write "数据库操作失败:" & err.description err.clear else if not (rs.eof and rs.bof) then '检测记录集是否为空 r=cint(rs.RecordCount) '记录总数 rowcount = 10 '设置每一页的数据记录数,可根据实际自定义 rs.pagesize = rowcount '分页记录集每页显示记录数 maxpagecount=rs.pagecount '分页页数 page=request.querystring("page") if page="" then page=1 end if rs.absolutepage = page rcount1=0 pagestart=page-5 pageend=page+5 if pagestart<1 then pagestart=1 end if if pageend>maxpagecount then pageend=maxpagecount end if rcount=rs.RecordCount '=============分页定义结束%>
您正在搜索“<%=search_q%>”,找到相关信息 <%=rcount%>
提示:用空格隔开多个搜寻关键词可获取更理想结果,如“最新 产品”。
<%'===========循环体开始 do while not rs.eof and rowcount%> <% select case rs("ArticleType") case 1 Content_FolderName=Article_FolderName case 2 Content_FolderName=Product_FolderName case 3 Content_FolderName=Case_FolderName end select title1=left(rs("title"),30) for i=0 to c title1=Replace(title1, keywords(i), "" & keywords(i)& "") next content1=left(nohtml(rs("content")),110) for i=0 to c content1=Replace(content1,keywords(i), "" & keywords(i)& "") next %>
<%=title1%>
<%=content1%>...
<%=web_url&"/"&Content_FolderName&"/"&rs("file_path")%><%=year(rs("time"))%>-<%=month(rs("time"))%>-<%=day(rs("time"))%>
<% rowcount=rowcount-1 rs.movenext loop '===========循环体结束%>
<% else response.write "
很抱歉,没有找到与 "&search_q&" 相关的信息!

提示:用空格隔开多个搜寻关键词可获取更理想结果,如“最新 产品”。

" end if end if end if%>