📄 search.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">
<!--#include file="conn.asp"-->
<wml>
<head>
<meta http-equiv="Cache-Control" content="must-revalidate" forua="true"/>
<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>
<meta http-equiv="Cache-Control" content="max-age=0" forua="true"/>
<meta http-equiv="Expires" content="0" forua="true"/>
<meta http-equiv="Pragma" content="no-cache" forua="true"/>
</head>
<%
id=TRim(Request("id"))
if not isnumeric(id) then id="1"
call main
Function main
txt=Request("txt")
IF txt<>"" then
set rs=server.createobject("adodb.recordset")
if id=1 then
sql="select * from btitle where title like '%"&txt&"%' or name like '%"&txt&"%'"
else
sql="select * from ufile where title like '%"&txt&"%' or name like '%"&txt&"%' or format like '%"&txt&"%'"
end if
rs.open sql,conn,1,1
page = Request("Page")
Rs.PageSize = 10 '一页10条记录
if not (rs.bof and rs.eof) then
IF Not IsEmpty(Page) Then
IF Not IsNumeric(Page) Then '判断Page是否为数字
Page=1
Else
Page=Cint(Page) '转换成短整形Integer
End IF
IF Page > Rs.PageCount Then
Rs.AbsolutePage = Rs.PageCount '设置当前显示页等于最后一页
ElseIF Page <= 0 Then
Rs.AbsolutePage = 1 '设置当前页等于第一页
Else
Rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
End IF
Else
Rs.AbsolutePage = 1
End IF
Page = Rs.AbsolutePage
%>
<card id="index" title="搜索结果"><p>
共找到相关记录<%=rs.RecordCount%>条<br/>
<%
For i=1 to Rs.PageSize
If Rs.Eof Then
Exit For
End If
if id=1 then
%>
<%=i+(page-1)*10%>:<a href='view.asp?id=<%=utf8(rs("id"))%>&lid=<%=utf8(rs("lid"))%>&bid=<%=utf8(rs("bid"))%>'><%=utf8(rs("name"))%></a>(<%=utf8(rs("kid"))%>)<br/>
<%
else
%>
<%=i+(page-1)*10%>:<a href='down.asp?did=<%=utf8(rs("id"))%>&lid=<%=utf8(rs("lid"))%>&id=<%=utf8(rs("cid"))%>'><%=utf8(rs("name"))%></a>(<%=utf8(rs("kid"))%>)<br/>
<%
end if
Rs.MoveNext
Next
if page<Rs.PageCount then%>
<anchor>下一页
<go href="search.asp?id=<%=id%>&Page=<%=(Page+1)%>" method='post'>
<postfield name="txt" value="$(txt)"/>
</go>
</anchor>
<%end if
if page>1 then%>
<anchor>上一页
<go href="search.asp?id=<%=id%>&Page=<%=(Page-1)%>" method='post'>
<postfield name="txt" value="$(txt)"/>
</go>
</anchor>
<%end if
if page >0 then
%><br/>共[<%=Page%>/<%=Rs.PageCount%>]页<br/><%
end if
else
%>
<card id="login" title="搜索结果">
<p align="<%=const_index%>">
没有找到相关记录。<br/>
<%end if
Rs.close
set rs=nothing
else%>
<card id="login" title="搜索出错">
<p align="<%=const_index%>">
搜索内容或搜索方式不能为空。<br/>
<%
end if
end Function%>
<br/><a href="/index.asp">网站首页</a>
</p></card>
</wml>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -