<!-- #include file="conn.asp" -->
<% s_sa=request.form("sa")
set rs=server.createobject("adodb.recordset")
sql="select * from zixun WHERE title like '%"&s_sa&"%' ORDER BY id desc"
rs.open sql,conn,1,1
Dim Rcount, Loopno, Mpage
Rcount = rs.Recordcount
If Pmcount="" or isempty(Pmcount) or Pmcount<1 then
Pmcount=6
End If
rs.Pagesize = pmcount '设置每页数
Mpage = rs.Pagecount '得到总页数
Pageno = Request("Pageno")
If Cint(Pageno) < 1 Then Pageno = 1
If Cint(Pageno) > Mpage Then Pageno = Mpage
If rs.Bof and rs.Eof then
Response.write "<tr><td colspan='6'> 暂时没有任何新闻!</td></tr>"
Else
rs.Absolutepage = Pageno '将指针移至指定页的第一条记录
Loopno = Pmcount
Do While Not rs.Eof and Loopno > 0 %>
<tr>
<td> </td>
</tr>
<tr>
<td><a href="detail.asp?id=<%=rs("id")%>" target="_blank">
<%title = Rs("title")
title=replace(title,s_sa,"<font color=""red"">" & s_sa & "</font>")
Response.write (title)
%></a> <br />http://www.xasq.cn/detail.asp?id=<%=rs("id")%><br />
<%=Left(Trim(rs("content")),80)%><br /></td>
</tr>
<%
rs.Movenext
Loopno=Loopno-1
Loop
%>
<tr>
<td> <div align="left"> 共 <%=Cstr(rcount)%> 条新闻 当前为:<font color="#FF0000"><%=Cstr(Pageno)&"</font>/"&Cstr(Mpage)%>页 每页 <%=pmcount%> 条</font></div></td>
<td>
<div align="right">
<%If Cint(Pageno)>1 Then%>
<font face="Webdings" color="#FF0000">7</font> <a href='?&pageno=<%=Pageno+1%>&sa=<%=s_sa%>'>上一页</a>
<%End If
If Cint(Pageno) < Cint(Mpage) Then
%>
<font face="Webdings" color="#FF0000">8</font> <a href='?&pageno=<%=Pageno+1%>&sa=<%=s_sa%>' >下一页</a>
<%End If%>
</td>
</tr> <% rs.Close
Set rs=Nothing
End if %>
</table>