|
我编写的这个搜索程序中出了点问题,就是按搜索虽然能够搜索出来,但是如果搜索出来的内容多了,他会分成几页显示,现在问题就是如果我搜索了,但是按下一页查看,就变成了没有搜索前显示的第二页,而不是搜索后结果的第二页,麻烦哪位高手帮我看一下,感激不尽!
quto.asp这个是搜索页面的內容
---------------------------------------------
<!--#include file="open.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>报价单</title>
<style type="text/css">
<!--
body,td,th {
font-size: 9pt;
}
-->
</style>
<link href="myweb.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style3 {color: #000099}
-->
</style>
</head>
<body>
<div align="center">
<form action="quto.asp" method="post" name="form1">
<table width="413" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td>
<div align="center"><img src="find_fdj.gif"> 报价搜索:
<input type="text" name="keyword" class="inputtext" size="20" >
<input type="submit" value=" 搜索 " name="querysumbit" >
</div></td></tr>
</table>
<span class="style3">(*请输入客户名、编号或名称进行搜索)</span>
</form>
<p><strong>报价表</strong> <a href="add_form.asp"><<添加报价>></a>
<%
id=Request("id")
if id<>"" then
sql="delete from link where No_="& id
con.Execute SQL
Response.write("<script>alert('记录删除成功')</script>")
end if
%>
<%'此处开始显示
on Error resume next
dim sql,rs,keyword
keyword=request.form("keyword")
set rs=server.createobject("adodb.recordset")
SQL="Select * from link where Name_ like '%"&trim(keyword)&"%' or Date_ like '%"&trim(keyword)&"%' or Khname like '%"&trim(keyword)&"%' order by No_ desc"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open SQL,con,1,1
rs.PageSize=30
count=1
if Request("count")<>"" then
count=Cint(Request("count"))
if count<1 then
count=1
end if
if count>rs.PageCount then
count=rs.PageCount
end if
end if
if not rs.Bof and not rs.Eof then
rs.ABSolutePage=count
end if
pagecountx=rs.pagecount
for i=0 to rs.PageSize
if ((count-1)*rs.PageSize)+i>rs.RecordCount-1 then
exit for
end if
%>
</p>
<table width="800" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr bgcolor="#CCCCCC">
<td colspan="10"><div align="center"></div> <div align="center"><font color="#FFFFFF">
<div align="left">发布日期:<%=rs("date_")%> |<a href="update_form.asp?id=<%=rs("No_")%>">修改</a>|<A
href="javascript:del(<%=rs("No_")%>)">删除</a>|</div>
</div></td>
</tr>
[知识问答ωωω.χiuGoo.сom]
<tr>
<td width="56"><div align="center"><strong>图片</strong></div></td>
<td colspan="9"> <div align="left"><img src=img/<%=rs("img")%> width="201" height="151"></div></td></tr>
<tr>
<td><div align="center">客户名</div></td>
<td width="83"><div align="center" ><b><font color=red><%=rs("khname")%></b></font></div></td>
<td width="53"><div align="center">编号</div></td>
<td width="105"><div align="center"><%=rs("item_")%></div></td>
<td width="38"><div align="center">名称</div></td>
<td width="166"><div align="center"><%=rs("name_")%></div></td>
<td width="33"><div align="center">规格</div></td>
<td width="108"><div align="center"><%=rs("spec")%></div></td>
<td width="31"><div align="center">材料</div></td>
<td width="105"><div align="center"><%=rs("Material")%></div></td>
</tr>
<tr>
<td height="20"><div align="center">外箱尺寸</div></td>
<td><div align="center"><%=rs("size_")%></div></td>
<td><div align="center">包装明细</div></td>
<td><div align="center"><%=rs("packaging")%></div></td>
<td><div align="center">重量</div></td>
<td><div align="center">净重:<%=rs("nw")%> 毛重:<%=rs("gw")%></div></td>
<td colspan="2"><div align="center"></div>
<div align="center"><%=rs("chfs")%></div></td>
<td><div align="center">报价</div></td>
<td><div align="center"><font color=red><%=rs("price")%></font></div></td>
</tr>
<%
rs.movenext
next
%>
</table>
<p>当前共有:<font color=#ff0000><%= rs.recordcount %></font>条记录</p>
<table width="465" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="366">
<center><strong><!--#include file="fy.asp" --></strong></center></td>
</tr>
</table>
<a href="#"><<返回顶部>></a>
<a href="index.asp"><<返回首页>></a>
<script>
function del(id)
{
if(confirm("请不要随便删除,按取消返回,确认删除?"))
location.href="quto.asp?id="+id+"&<%=rs("no_")%>>";
}
</script>
<!--#include file="down.asp" -->
<p> </p>
</div>
<!--#include file="close.asp" -->
</body>
</html>
----------------------------------------------------------------------------------------
fy.asp这个是显示首页、上一页、下一页的内容
---------------------》
<%
url=Request.ServerVariables("SCRIPT_NAME")
function fy()
dim temp
for each name1 in Request.form
if name1<>"count" then
temp=temp&"&"&name1&"="&Request.Form(name1)
end if
next
for each name1 in Request.QueryString
if name1<>"count" then
temp=temp&"&"&name1&"="&Request.QueryString(keyword)
end if
next
fy=temp
end function
%>
<a href="<%=url%>?count=1<%=fy()%>">首 页</a> <a href="<%=url%>?count=<%=count-1%><%=fy()%>">上一页</a> 第 <%=count%> 页 <a href="<%=url%>?count=<%=count+1%><%=fy()%>">下一页</a> <a href="<%=url%>?count=<%=PageCountx%><%=fy()%>">尾 页</a>,共 <%=PageCountx%> 页
</body>
</html> |
|