<%@Language="VBScript" CodePage="65001" %> <% search_q=request.querystring("q") %> Search<%=search_q%>_$web_name$ <% 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 [en_article] "&search_sql1&" ) and view_yes=1 order by [time] desc" %>
Contact Us   
Your Position: Home > Search
<% 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 '=============分页定义结束%>
Your are search '<%=search_q%>',found results <%=rcount%>
Tips: Use space in keyowrds for more results, for example:'new product'.
<%'===========循环体开始 do while not rs.eof and rowcount%> <% select case rs("ArticleType") case 1 Content_FolderName=Article_FolderName case 2 Content_FolderName=Product_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 %>
<% rowcount=rowcount-1 rs.movenext loop '===========循环体结束%>
<% else response.write "
Sorry,no results for "&search_q&" !

Tips: Use space in keyowrds for more results, for example:'new product'.

" end if end if end if%>