日期:2014-05-16  浏览次数:20763 次

奇怪的搜索结果分页问题
本帖最后由 cnxianze 于 2012-12-05 12:30:28 编辑
能准确显示页数和条数,但就不能分页,依然所有搜索结果都是显示在一页。

代码如下:
<!--#include file="utf-8.asp"-->
<!--#include file="conn.asp" -->
<!--#include file="config.asp" -->
<!--#include file="page.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=request("key")%> - 先泽电器开关搜索“<%=request("key")%>”</title>
<meta name="description" content="您现正搜索的是:<%=request("key")%>;<%=config("description")%>" />
<meta name="keywords" content="<%=request("key")%>,<%=config("keywords")%>" />
<link href="images/style.css" type="text/css" rel="stylesheet" />
</head>
<body bgcolor="<%=config("bg")%>">
<!--#include file="header.asp" -->
<div align="center"><img src="/images/logo.jpg" width="100" height="80" alt="<%=config("title")%>" title="<%=config("title")%>" /></div>
  <tr>
    <td height="20">
    <div style="border-bottom:#005AB5 15px solid;"></div></td>
  </tr>
<!--#include file="search_so.asp" -->
<%
t=Trim(Request.Form("t"))
key=Trim(Request.Form("key"))
if t="" or key="" then
 Response.Write("<script>alert('请输入关键词!');history.back();</script>")
 Response.End()
end if
if t=1 then
 sql="select * from [shop] where 1=0"
else
 sql="select * from [news] where 1=0"
end if
keyArr=split(key," ")
for i=0 to ubound(keyArr)
  sql=sql&" or title like '%"&keyArr(i)&"%'"
next
set rs=conn.execute(sql)
if t=1 then
%>
<table width="917" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#F0F0F0">
          <tr>
            <td bgcolor="#EBEBEB"><table width="98%" border="0" cellpadding="10" cellspacing="0">
                <tr>
        <td>&nbsp;<b>关于先泽电器开关“<font color="#FF0000"><%=key%></font>”的搜索结果:</b></td>
                </tr>
              </table></td>
          </tr>
          <tr>
  &nb