<!--#include file="conn.asp"-->
<!--#include file="inc/Function.asp"-->
<!--#include file="inc/sub.asp"-->
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
dim Action
Action=Trim(request("Action"))
%>
<%
if Action="sou" then
call sou()
end if
%>
<form method="POST" action="sou.asp" name="myform">
<table width="800">
<tr>
<td><input name="sou" type="text"></td>
<td><input name="action" type="hidden" value="sou">
<input name="b" type="submit" value="搜索"></td>
</tr>
</table>
</form>
<% sub sou()
dim sql,sou,page,i,id
sou=Check_str(request.form("sou"))
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.maxrecords=20
SQL="Select * from article where title like '%"&trim(sou)&"%' or author like '%"&trim(sou)&"%' or content like '%"&trim(sou)&"%' or fclass like '%"&trim(sou)&"%'order by ID Desc"
rs.Open sql,conn,3,1'数据表内最多显示的数据条数
rs.pagesize=1'一页最多显示的最多数据条数
if not rs.eof then
page=clng(request("page"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.absolutepage=page
%>
<table width="100%" border="1" cellpadding="1" >
<tr>
<td align="center">标题</td>
<td align="center">作者</td>
<td align="center">时间</td>
<td align="center">内容</td>
<td align="center">文章类型</td>
</tr>
<%
for i=1 to rs.pagesize
id=(page-1)*rs.pagesize+i 'do while not rs.eof %>
<tr>
<%response.Write "<td><a href='forecast.asp?ID="&rs("ID")&"'>" & gotTopic(rs("title"),24) &"</td>"%>
<%response.Write "<td align=center >" & gotTopic(rs("author"),24) &"</td>"%>
<%response.Write "<td align=center>" & gotTopic(rs("times"),24) &"</td>"%>
<%response.Write "<td align=center><a href='forecast.asp?ID="&rs("ID")&"'target=_blank>" & gotTopic(rs("content"),10) &"</a></td>"%>
<%response.Write "<td align=center >" & gotTopic(rs("fclass"),24) &"</td>"%>
</tr>
<% rs.movenext
if rs.eof then exit for
'loop
next
else
response.Write ("<tr><td colspan=7 align=center>还没有任何信息</td></tr>")
end if
%>
<tr>
<td colspan="6" align="center"><%
if page <>1 then
response.write "<a href=sou.asp?page=1&sou="&sou&">第一页</a> "
response.write "<a href=sou.asp?page=" & (page-1) & "&sou="&sou&">上一页</a> "
end if
if page<>rs.pagecount then
response.write "<a href=sou.asp?page=" & (page+1) & "&sou="&sou&">下一页</a> "
response.write(action)
response.write "<a href=sou.asp?page=" & rs.pagecount & "&sou="&sou&">最后一页</a> "
end if
%>
<p>页数:<% =page %>/<% =rs.pagecount %></p></td>
</td>
</table>
<%
rs.close
set rs=nothing
%>
<% end sub %>
</body>
</html>