首页 > 网站 > 建站经验 > 正文

asp 分页 上_一页 下一页代码

2019-11-02 14:56:13
字体:
来源:转载
供稿:网友

<%if request("typeid")=3 then
set rs=server.CreateObject("adodb.recordset")
  rs.open "select cdkey88_news.*,cdkey88_game.game_name from cdkey88_news,cdkey88_game where cdkey88_news.game_id=cdkey88_game.game_id and ( cdkey88_news.news_title like '%"&request("keywords")&"%' or cdkey88_news.news_content like '%"&request("keywords")&"%' or cdkey88_game.game_name like '%"&request("keywords")&"%') order by cdkey88_news.news_id desc",conn,1,1
%>
<table width="960" border="0" cellpadding="0" cellspacing="4" align="center" bgcolor="#FFFFFF">
  <!--DWLayoutTable-->
  <tr>
    <td width="700" height="206" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <%
   if rs.eof then
 response.write"<tr><td colspan=9 height=50 align=center><font color=#ff0000>对不起,没有找到相关记录!</font></td></tr>"
 end if
 if rs.recordcount<>0 then
 rs.pagesize=20
    if request("page")<>"" then
 currentpage=cint(request("page"))
 else
 currentpage=1
 end if
 if currentpage<=1 then
 currentpage=1
 end if
 if currentpage=>rs.pagecount then
 currentpage=rs.pagecount
 end if
 rs.AbsolutePage=currentpage
 end if
 do while not rs.eof
   %>
      <tr>
        <td width="700" height="131" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <!--DWLayoutTable-->
          <tr>
            <td width="700" height="30" valign="middle">&nbsp;<a href="news/show_news.asp?news_id=<%=rs("news_id")%>" target="_blank"><font color="#669933" style="font-size:14px"><b><%=rs("news_title")%></b></font></a></td>
            </tr>
          <tr>
            <td width="700" height="25" valign="middle">&nbsp;相关游戏

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表