% const MaxPerPage=10 dim totalPut dim CurrentPage dim TotalPages dim i,j dim sql dim rs dim rstype dim typesql dim typeid,typename1 if not isEmpty(request("typeid")) then typeid=request("typeid") else typeid=1 end if if not isempty(request("page")) then currentPage=cint(request("page")) else currentPage=1 end if sqlconfig="select * from config" set rsconfig=server.createobject("adodb.recordset") rsconfig.open sqlconfig,conn,1,1 sousuo="" sousuo=sousuo&"
" bottomnavi="" footer="" footer=footer&"| Copyright © "&rsconfig("copyrights")&" All Rights Reserved |
| "&rsconfig("saddress")&":"&rsconfig("address")&" 邮政编码:"&rsconfig("postcode")&" |
| E-mail:"&rsconfig("webemail")&" |
"&rsconfig("copyright")&" "&rsconfig("superstat")&" |
|
|
搜索结果 —— <% page=request("page") if page="" then page=0 ssort=request("ssort") keywords=request("keywords") keywords=LTRIM(RTRIM(keywords)) if ssort="1" then set rs=server.createobject("adodb.recordset") sql ="select * from article inner join type on article.typeid=type.typeid where (title like '%"&checkStr(keywords)&"%') order by date Desc" rs.open sql,conn,1,1%> 按 " 新闻标题 " 搜索 关键词为 : <%=keywords%> <% end if if ssort="2" then set rs=server.createobject("adodb.recordset") sql ="select * from article inner join type on article.typeid=type.typeid where (content like '%"&checkStr(keywords)&"%') order by date Desc" rs.open sql,conn,1,1%> 按 " 新闻内容 " 搜索 关键词为 : <%=keywords%> <% end if %> <% if rs.eof and rs.bof then response.write " 最新数据中没有查到符合条件的记录! " else totalPut=rs.recordcount totalPut=rs.recordcount if currentpage<1 then currentpage=1 end if if (currentpage-1)*MaxPerPage>totalput then if (totalPut mod MaxPerPage)=0 then currentpage= totalPut \ MaxPerPage else currentpage= totalPut \ MaxPerPage + 1 end if end if if currentPage=1 then showContent showpage totalput,MaxPerPage,"Search.html" else if (currentPage-1)*MaxPerPage<% i=i+1 if i>=MaxPerPage then exit do rs.movenext loop %> <%end sub function showpage(totalnumber,maxperpage,filename) dim n if totalnumber mod maxperpage=0 then n= totalnumber \ maxperpage else n= totalnumber \ maxperpage+1 end if ' response.write " "
response.write " | 在最新数据中搜索到"&totalnumber&"条符合条件的信息 " response.write "页次:"&CurrentPage&"/"&n&"页 每页20条" if CurrentPage<2 then response.write "【首页】【上一页】" else response.write "【首页】" response.write "【上一页】" end if if n-currentpage<1 then response.write "【下一页】【尾页】" else response.write "" response.write "【下一页】【尾页】 " end if ' response.write "<% =word %> 在历史数据中搜索到<% =result_num %>条符合条件的信息 <% for i=1 to rs.PageSize %> <% rs.movenext:if rs.EOF then Exit For next %> <% call LastNextPage(maxpage,page,"width=100% ","") %> <% end if %> |
||||||||||||
|
||
|