我有个自己编的ASP程序,如果搜索找到有下一页的纪录时(比如3页纪录)按“下一页”它直接打开整个纪录的第二页,而不是搜索找到的第二页下面是代码,我加keyword=<%=keyword%>这个,也没用,请高手帮忙
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<link rel="stylesheet" href="Admin_STYLE.CSS">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language = "JavaScript">
function CheckForm()
{
if (document.search.keyword.value=="")
{
alert("搜索关键字不能为空!");
document.search.keyword.focus();
return false;
}
if (document.search.keyword.value=="输入搜索关键字")
{
alert("请输入搜索关键字!");
document.search.keyword.focus();
return false;
}
return true;
}
</script>
</head>
<body bgcolor="#DDDDDD" topmargin="0" leftmargin="0">
<div align="center" style="border-bottom-style: solid; border-bottom-width: 1px; padding-bottom: 1px">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#006D91" width="100%">
<tr>
<td width="100%" bgcolor="#FFFFFF">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" >
<tr>
<td width="99%" class="topbg" style="background-image: url('Images/topBar_bg.gif')">
<b>会员卡挂失管理</b></td></tr></table>
<%
page = request.querystring("page")
keyword1 = request.form("keyword")
if keyword1="已" or keyword1="已补办" then
keyword = "补办"
else
keyword = keyword1
end if
serch1 = request.form("serch1")
if keyword <> "" then
sql = "select * from XFL where yuankahao like '%"&keyword&"%' or shenqingren like '%"&keyword&"%' or zhengjianhao like '%"&keyword&"%' or jin_e like '%"&keyword&"%'or shenqingriqi like '%"&keyword&"%'or jingshouren like '%"&keyword&"%'or xiankahao like '%"&keyword&"%'or heduijin_e like '%"&keyword&"%'or bubanren like '%"&keyword&"%'or best like '%"&keyword&"%'or bubanriqi like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="原卡号" then
sql ="select * from XFL where yuankahao like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="申请人" then
sql ="select * from XFL where shenqingren like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="证件号" then
sql ="select * from XFL where zhengjianhao like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="金额" then
sql ="select * from XFL where jin_e like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="申请日期" then
sql ="select * from XFL where shenqingriqi like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="经手人" then
sql ="select * from XFL where jingshouren like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="现卡号" then
sql ="select * from XFL where xiankahao like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="核对金额" then
sql ="select * from XFL where heduijin_e like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="补办日期" then
sql ="select * from XFL where bubanriqi like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="补办人" then
sql ="select * from XFL where bubanren like '%"&keyword&"%'order by id desc"
elseif keyword <> "" and serch1 ="操作" then
sql ="select * from XFL where best like '%"&keyword&"%'order by id desc"
else
sql = "select * from XFL where yuankahao like '%"&keyword&"%' or shenqingren like '%"&keyword&"%' or zhengjianhao like '%"&keyword&"%' or jin_e like '%"&keyword&"%'or shenqingriqi like '%"&keyword&"%'or jingshouren like '%"&keyword&"%'or xiankahao like '%"&keyword&"%'or heduijin_e like '%"&keyword&"%'or bubanren like '%"&keyword&"%'or best like '%"&keyword&"%'or bubanriqi like '%"&keyword&"%'order by id desc"
end if
set rs = server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof or rs.bof then
%>
<p style="margin-top: 2" align=center><br><br><br><font color="#FF0000">没有找到相关记录
<a href="Search.asp"><font color="#0000FF">重新搜索</font></a></font><br><br><br>
<%
else
rs.pagesize = "20"
if page = "" or page < "1" then
page = "1"
end if
if rs.pagecount > "0" then
rs.absolutepage = page
end if
i = "0"
%>
<center><br>
<table border="1" cellpadding="0" style="border-collapse: collapse; border-right-width:0px" bordercolor="#111111" width="331" height="62" bgcolor="#EFEFEF">
<form method="post" action="Search.asp" name="search" onSubmit="return CheckForm();">
<tr>
<td width="111" align="center" style="border-left: 1px solid #111111; border-right-style: none; border-right-width: medium; border-top: 1px solid #111111; border-bottom: medium none #111111; "><p style="margin-top: 2">
添入关键字 </p></td>
<td width="110" align="center" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top: 1px solid #111111; border-bottom-style: none; border-bottom-width: medium"><input type="text" size="20" name="keyword" style="width: 100; height: 16" onmouseover="this.style.borderColor='#486841';this.style.backgroundColor='#E2F1A6'" onmouseout="this.style.borderColor='#006D91';this.style.backgroundColor='#EFEFEF'"></td>
<td width="110" align="center" rowspan="2" style="border-left-style: none; border-left-width: medium; border-right-color: #111111; border-right-width: 1px; border-top-color: #111111; border-top-width: 1px; border-bottom-color: #111111; border-bottom-width: 1px">
<input border="0" height="16" name="imageField" src="images/20.gif" type="image" width="47"></td>
</tr>
<tr>
<td width="111" align="center" style="border-left: 1px solid #111111; border-right-style: none; border-right-width: medium; border-top: medium none #111111; border-bottom: 1px solid #111111">
高级搜索</td>
<td width="110" align="center" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom: 1px solid #111111">
<SELECT name="serch1" font face="宋体" style="font-size: 9pt" size="1">
<option selected>选择搜索范围</option>
<option>原卡号</option>
<option>申请人</option>
<option>证件号</option>
<option>金额</option>
<option>申请日期</option>
<option>经手人</option>
<option>现卡号</option>
<option>核对金额</option>
<option>补办日期</option>
<option>补办人</option>
<option>操作</option>
</td>
</tr>
</form>
</table><br>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="3">
<tr>
<td width="100%"></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="1" cellpadding="0" id="table1" height="29"><tr>
<td width="41" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#000000">序号</font></td>
<td width="45" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#000000">原卡号</font></td>
<td width="140" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#000000">申请人</font></td>
<td width="166" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#000000">证件号</font></td>
<td width="55" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#000000">金额</font></td>
<td width="76" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#000000">申请日期</font></td>
<td width="102" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#000000">经手人</font></td>
<td width="45" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#0000FF">现卡号</font></td>
<td width="62" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#0000FF">核对金额</font></td>
<td width="73" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#0000FF">补办日期</font></td>
<td width="108" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#0000FF">补办人</font></td>
<td width="62" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px" bgcolor="#DDDDDD">
<font color="#FF0000">操作</font></td>
</tr>
<%
do while not rs.eof or rs.bof
i = i + 1
if i > rs.pagesize then
exit do
end if
%>
<tr>
<td width="41" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><%=rs("id")%></td>
<td width="36" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><%=rs("yuankahao")%></td>
<td width="140" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><%=rs("shenqingren")%></td>
<td width="166" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><%=rs("zhengjianhao")%></td>
<td width="55" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><%=rs("jin_e")%></td>
<td width="76" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><%=rs("shenqingriqi")%></td>
<td width="102" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><%=rs("jingshouren")%></td>
<td width="45" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><font color="#0000FF"><%=rs("xiankahao")%></font></td>
<td width="62" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><font color="#0000FF"><%=rs("heduijin_e")%></font></td>
<td width="73" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><font color="#0000FF"><%=rs("bubanriqi")%></font></td>
<td width="108" align="left" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px"><font color="#0000FF"><%=rs("bubanren")%></font></td>
<td width="62" align="center" height="27" bordercolor="#006D91" style="border-style: solid; border-width: 1px">
<%
if rs("best")="办理" then
%>
<a href="Search.asp?action=modifymovie&movieid=<%=rs("id")%>">
<font color="#0000FF">办理</font></a>
<%
Elseif rs("best")="补办" then
response.write"<font color='#FF0000'>已补办</font>"
%>
<%
Else
response.write"<font color='#000000'>解除</font>"
End If
%>
<%if session("name")="gialot" then%><br><a href="Search.asp?action=delmovie&movieid=<%=rs("id")%>"><font color="#FF00FF">删除</font></a><%end if%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#006D91" width="100%">
<tr>
<td width="100%" bgcolor="#EFEFEF" align="center"><p style="margin-top: 2">[第<%=page%>页/共<%=rs.pagecount%>页] <%if page = "1" then%>[首页] [上一页] <%else%>[<a href="Search.asp">首页</a>] [<a href="Search.asp?page=<%=page-1%>">上一页</a>] <%end if%><%if rs.pagecount-page < 1 then%>[下一页] [尾页]<%else%>[<a href="Search.asp?page=<%=page+1%>&keyword=<%=keyword%>">下一页</a>] [<a href="Search.asp?page=<%=rs.pagecount%>">尾页</a>]<%end if%></td>
</tr>
</table>
<%
end if
rs.close
set rs = nothing
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="3">
<tr>
<td width="100%"></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
<%
conn.close
set conn = nothing
%>