📄 result.asp
字号:
<%@ Language=VBScript%>
<!--#include file=include/conn.asp -->
<!--#include file=include/config.asp -->
<%
request_BigClassName=Request("BigClassName")
keyword=trim(Request("keyword"))
PageShowSize = 10 '每页显示多少个页
MyPageSize = 20 '每页显示多少条
If Not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Or Request("page") <=0 Then
MyPage=1
Else
MyPage=Int(Abs(Request("page")))
End if
if keyword="" or keyword="关键字" then
%>
<script language=javascript>
history.back()
alert("请输入查询关键字!")
</script>
<%
Response.End
end if
if request("action")="" then
findword="title like '%"&keyword&"%' or content like '%"&keyword&"%'"
elseif request("action")="title" then
findword="title like '%"&keyword&"%' "
elseif request("action")="content" then
findword="content like '%"&keyword&"%' "
end if
set rs=server.CreateObject("ADODB.RecordSet")
rs.Source="select * from BigClass order by BigClassID"
rs.Open rs.Source,conn,1,1
dim ArrayBigClassID(10000),ArrayBigClassName(10000)
BigClassCount=rs.RecordCount
for i=1 to BigClassCount
ArrayBigClassID(i)=rs("BigClassID")
ArrayBigClassName(i)=rs("BigClassName")
rs.MoveNext
next
rs.Close
if request_BigClassName><"" then
rs.Source="select NewsID,Title,UpdateTime,BigClassName,SmallClassName,SpecialID,image,click from News where BigClassName='" & request_BigClassName &"' and " & findword & " order by NewsID DESC"
else
rs.Source="select NewsID,Title,UpdateTime,BigClassName,SmallClassName,SpecialID,image,click from News where " & findword & " order by NewsID DESC"
end if
rs.Open rs.Source,conn,1,1
rs.PageSize=20
rs.CacheSize = RS.PageSize
for i=1 to rs.PageSize *( page-1)
if not rs.EOF then
rs.MoveNext
end if
next
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>关键字:<%=keyword%>__搜索__<%=redcaff%></title>
<LINK href=news.css rel=stylesheet>
</head>
<body topmargin="0">
<!--#include file=include/top.asp -->
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr valign="top" bgcolor="<%=border%>">
<td height="1" width="1"></td>
<td height="1" width="748"></td>
<td height="1" width="1"></td>
</tr>
</table>
<table border="0" width="750" align=center cellspacing="0" cellpadding="0" bgcolor="<%=border%>">
<tr valign="middle">
<td width="1" ></td>
<td bgcolor=#FFFFFF width="15"> </td>
<td bgcolor=#FFFFFF align=left width="736" height="22"><b>分类栏目</b>
<%for i=1 to BigClassCount
TdString=" | <a class=class href='BigClass.asp?BigClassID=" & ArrayBigClassID(i) & "&BigClassName="& ArrayBigClassName(i) &"'>" & ArrayBigClassName(i) & "</a>"
Response.Write TdString
Next
%>
</td>
<td width="1" align=left></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<%=bgcolor1%>">
<tr valign="top">
<td height="1" width="1" bgcolor="<%=border%>"></td>
<td height="1" width="748" bgcolor="<%=border%>"></td>
<td height="1" width="1" bgcolor="<%=border%>"></td>
</tr>
<tr valign="top">
<td bgcolor="<%=border%>" width="1"></td>
<td width="748" bgcolor="<%=t_m_bg%>"> </td>
<td bgcolor="<%=border%>" width="1"></td>
</tr>
<tr valign="top">
<td height="1" width="1" bgcolor="<%=border%>"></td>
<td height="1" width="748" bgcolor="<%=border%>"></td>
<td height="1" width="1" bgcolor="<%=border%>"></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="<%=border%>">
<tr>
<td>
<table width="748" border="0" cellspacing="0" cellpadding="0" bgcolor="ffffff" align="center">
<tr>
<td width="15"> </td>
<td width="637" height="20">当前位置:<a href=./ class=class>首页</a>>>搜索>>关键字:<%=keyword%></td>
<td width="91"> </td>
</tr>
</table>
</td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr valign="top" bgcolor="<%=border%>">
<td height="1" width="1"></td>
<td height="1" width="748"></td>
<td height="1" width="1"></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td bgcolor="<%=border%>" width="1"></td>
<td width="160" align="center" valign="top" bgcolor="<%=l_bg%>">
<table border="0" width="100%" cellspacing="1" cellpadding="0" bgcolor="<%=l_main%>">
<tr>
<td width="100%" bgcolor="<%=l_top%>" height="18">
<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="<%=l_main%>">
<tr>
<td bgcolor="<%=l_top%>" align="center" > <font class=l_title>资料搜索</font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" align=center height="40" valign="middle" bgcolor="<%=l_main%>">
<!--#include file=search.asp-->
</td>
</tr>
</table>
</td>
<td width="1"></td>
<td width="587" align="center" valign="top" bgcolor="<%=m_bg%>" height="378">
<table border="0" width="98%">
<tr>
<td width="69%" align="center" valign="top">
<table border="0" cellpadding="3" cellspacing="0" width="100%">
<%
Response.Write "<tr><td width=100% height=28> "
if rs.EOF then
Response.Write "<font color=red>抱歉,没有搜索到相关的资料!</font>"
else
rs.PageSize = MyPageSize
MaxPages = rs.PageCount
rs.absolutepage = MyPage
total = rs.RecordCount
Response.Write "共搜索到" & total & "条相关资料,当前第"& myPage &"/"& MaxPages &"页,每页"& rs.PageSize &"条"
end if
Response.Write "</td></tr>"
If Not rs.eof then
i = 0
do until rs.Eof or i = rs.PageSize
if rs("image")=>1 then
img="<img src='images/img.gif' height='9' border='0'>"
else
img=""
end if
%>
<tr>
<td width="100%" height="20"> <img src="images/go.gif" width="10" height="9" border="0"> <a class=middle href="ReadNews.asp?NewsID=<%=rs("NewsID")%>&BigClassName=<%=rs("BigClassName")%>&SmallClassName=<%=rs("SmallClassName")%>&SpecialID=<%=rs("SpecialID")%>" target=_blank><%=trim(rs("Title"))%></a><font class=middle>(<%=rs("UpdateTime")%>)[<font color="#ff0000"><%=rs("click")%></font>]</font><%=img%></td>
</tr>
<%
rs.MoveNext
i = i + 1
loop
%>
<tr>
<td width=100% align=center> </td>
</tr>
<tr>
<td width="100%" align=center>第 <%=Mypage%>/<%=Maxpages%> 页,每页 <%=MyPageSize%>
条
<%
url="Result.asp?BigClassName=" & request_BigClassName & "&keyword=" & keyword
PageNextSize=int((MyPage-1)/PageShowSize)+1
Pagetpage=int((total-1)/rs.PageSize)+1
if PageNextSize >1 then
PagePrev=PageShowSize*(PageNextSize-1)
Response.write "<a class=black href='" & Url & "&page=" & PagePrev & "' title='上" & PageShowSize & "页'>上一翻页</a> "
Response.write "<a class=black href='" & Url & "&page=1' title='第1页'>页首</a> "
end if
if MyPage-1 > 0 then
Prev_Page = MyPage - 1
Response.write "<a class=black href='" & Url & "&page=" & Prev_Page & "' title='第" & Prev_Page & "页'>上一页</a> "
end if
if Maxpages>=PageNextSize*PageShowSize then
PageSizeShow = PageShowSize
Else
PageSizeShow = Maxpages-PageShowSize*(PageNextSize-1)
End if
If PageSizeShow < 1 Then PageSizeShow = 1
for PageCounterSize=1 to PageSizeShow
PageLink = (PageCounterSize+PageNextSize*PageShowSize)-PageShowSize
if PageLink <> MyPage Then
Response.write "<a class=black href='" & Url & "&page=" & PageLink & "'>[" & PageLink & "]</a> "
else
Response.Write "<B>["& PageLink &"]</B> "
end if
If PageLink = MaxPages Then Exit for
Next
if Mypage+1 <=Pagetpage then
Next_Page = MyPage + 1
Response.write "<a class=black href='" & Url & "&page=" & Next_Page & "' title='第" & Next_Page & "页'>下一页</A>"
end if
if MaxPages > PageShowSize*PageNextSize then
PageNext = PageShowSize * PageNextSize + 1
Response.write " <A class=black href='" & Url & "&page=" & Pagetpage & "' title='第"& Pagetpage &"页'>页尾</A>"
Response.write " <a class=black href='" & Url & "&page=" & PageNext & "' title='下" & PageShowSize & "页'>下一翻页</a>"
End if
End If
rs.close
%>
</td>
</tr>
<tr>
<td width="100%"> </td>
</tr>
<tr>
<td width="100%"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td bgcolor="<%=border%>" width="1"></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr valign="top" bgcolor="<%=border%>">
<td height="1" width="1"></td>
<td height="1" width="748"></td>
<td height="1" width="1"></td>
</tr>
</table>
<!--#include file=include/bottom.asp -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -