📄 search.asp
字号:
<!--#include file=conn.asp-->
<HTML><HEAD><TITLE>站内搜索</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="style.css" type=text/css rel=stylesheet>
<BODY style="cursor:url(images/2.gif)">
<DIV align=center>
<!--#include file=top.asp-->
<%if request("keyword")="" then
response.write"<p><font color=white size=3>错误:搜索关键字不能为空!<br><a href=javascript:history.back()><font color=white>返回</font></a></font></p>"
response.end
end if%>
<%if request("condition")="标题" then
rs.open"select * from article where title like '%"&request("keyword")&"%'",conn,1,1
elseif request("condition")="内容" then
rs.open"select * from article where content like '%"&request("keyword")&"%'",conn,1,1
end if%>
<table width="760" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td bgcolor="eeeeee"> 搜索到 <font color=red><%=rs.recordcount%></font> 篇文章......</td>
</tr>
<%if not rs.eof then
rs.pagesize=15
maxrecord=rs.recordcount
maxpage=rs.pagecount
if request("p")="" then
p=1
else
p=request("p")
end if
if p>maxpage then
p=maxpage
end if
if p=0 then
p=1
end if
if p<>0 then
rs.move (p-1)*rs.pagesize
end if
for i=1 to rs.pagesize%>
<tr>
<td><img src="images/new01.gif">[<font color="6495ed"><%=year(rs("sendtime"))&"/"&month(rs("sendtime"))&"/"&day(rs("sendtime"))%></font>]<a href=showatc.asp?id=<%=rs("id")%>><%=rs("title")%></a><p></td>
</tr>
<%rs.movenext
if rs.eof then exit for
next%>
<tr>
<td bgcolor="eeeeee">
<a href=search.asp?condition=<%=request("condition")%>&keyword=<%=request("keyword")%>&p=1>首页 </a>
<a href=search.asp?condition=<%=request("condition")%>&keyword=<%=request("keyword")%>&p=<%=p-1%>>上页 </a>
<a href=search.asp?condition=<%=request("condition")%>&keyword=<%=request("keyword")%>&p=<%=p+1%>>下页 </a>
<a href=search.asp?condition=<%=request("condition")%>&keyword=<%=request("keyword")%>&p=<%=maxpage%>>尾页 </a>
共<font color=red><%=maxpage%></font>页,当前页<font color=red><%=p%></font>,每页<font color=red>15</font>篇</td>
</tr>
<%rs.close
end if%>
</table>
<!--#include file="bottom.asp"-->
</DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -