下面是我的一段代码,第一次表单提交后结果可以分页显示,但是点击下一页后,显示无内容,经过分析是 点击后表单提交的内容为空 查询不多内容,但是我看了其他的程序也是这样,但没有问题,这是为什么? 主要是加黑的地方,如果我把提交指改为常数,一切正常
<!--#include file=share/conn.asp -->
<%
kwjid=1
set rs2=server.CreateObject ("ADODB.RecordSet")
rs2.Source="select * from mgzb where kwjid="&kwjid
rs2.Open rs2.source,conn
%>
<%
set rs3=server.createobject("adodb.recordset")
sql3 = "select * from mkxxb "
rs3.open sql3,conn,1,1
%>
<script language="JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs3.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs3("coalname"))%>","<%= trim(rs3("mgzid"))%>","<%= trim(rs3("mkid"))%>");
<%
count = count + 1
rs3.movenext
loop
rs3.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.form1.coalname.length = 0;
document.form1.coalname.options[document.form1.coalname.length] = new Option("+++请选择煤矿+++", "");
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.form1.coalname.options[document.form1.coalname.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<script language="JavaScript">
<!--
function na_select_form (fname, type_name)
{
document.forms[fname].elements[type_name].select()
document.forms[fname].elements[type_name].focus()
}
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="/share/NEWS.CSS">
<title>无标题文档</title>
</head>
<body>
<SCRIPT >
<!--
function pop(pageurl)
{
var
popwin=window.open(pageurl,"popWin","scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,width=569,height=130,top=260,left=305");
return false;
}
-->
</SCRIPT>
<div align="center">
<form name=form1 method="POST" action="">
<table border="1" width="100%" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="ffffff">
<tr align="center">
<td width="206" height="21" bgcolor="ffffff">选择煤矿</td>
</tr>
<input type=hidden name="typeid" value="kwjid">
<tr bgcolor="#FFFFFF">
<td align="center"><p><select name="mgzid" onChange="changelocation(document.form1.mgzid.options[document.form1.mgzid.selectedIndex].value)" size="1">
<option value="" selected>++请选择矿管站++</option>
<%
do while not rs2.eof
mgzid=rs2("mgzid")
%>
<option value="<%=trim(rs2("mgzid"))%>"><%=trim(rs2("mgzname"))%></option>
<%
rs2.movenext
loop
rs2.close
%>
</select>
<br>
<select name="coalname" size="1">
<option value="">+++请选择煤矿+++</option>
</select>
</p></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center" height="55" bgcolor="<%=m_top%>"> <input type="reset" value=" 返 回 " name="B1" onclick=javascript:history.go()>
<input type="submit" value=" 查询 " name="B1"></td>
</tr>
</table>
</form>
<%
mgzid=trim(request("mgzid"))
mkid=trim(request("coalname"))
dim page
page=request("page")
if mkid<>"" then
sql="select username , userduty,coalname,mgzname,ygid from ryxxv where mgzid='"&mgzid&"' and mkid='"&mkid&"' order by ygid"
rs.open sql,conn,1,,1
else
sql="select username , userduty,coalname,mgzname,ygid from ryxxv where mgzid='"&mgzid&"' order by ygid"
rs.open sql,conn,1,,1
end if
if not rs.eof then
IF not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Then
page=1
Else
page=Int(Abs(Request("page")))
End if
rs.pagesize =10
total = rs.RecordCount
mypagesize=rs.pagesize
rs.absolutepage = page
%>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="142"><div align="center">员工id</div></td>
<td width="154">员工名字</td>
<td width="162">员工职务 </td>
<td width="170">所属煤矿</td>
<td width="140">所属煤管站</td>
</tr>
<%
while not rs.eof and mypagesize>0
%>
<tr>
<td><%=rs("ygid")%></td>
<td><a href="xinxi.asp?ygid=<%=rs("ygid")%> " onClick="return pop(this.href)" target="_blank"><%=rs("username")%></a></td>
<td><%=rs("userduty")%></td>
<td><%=rs("coalname")%></td>
<td><%=rs("mgzname")%></td>
</tr>
<%
rs.movenext
mypagesize=mypagesize-1
wend
%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="form2" method="post" action="ycheckorder.asp">
<tr>
<td align="center">共<font color=#ce0000><b><%=rs.pagecount%></b></font>页<font color=#ce0000><b><%=total%></b></font>条信息 当前第<font color=#ce0000><b><%=page%></b></font>页 <a href="ycheckorder.asp?page=1">首页</a>
<%if page>1 then%>
<a href=ycheckorder.asp?page=<%=page-1%>>上一页</a>
<%else%>
上一页
<%end if%>
<%if page<rs.pagecount then%>
<a href=ycheckorder.asp?page=<%=page+1%>>下一页</a>
<%else%>
下一页
<%end if%>
<a href=ycheckorder.asp?page=<%=rs.pagecount%>>尾页</a>
<select name="page" class="input">
<%for i=1 to rs.pagecount%>
<option value=<%=i%>
<%
if i=page then
response.write" selected"
end if
%>
>第<%=i%>页</option>
<%next%>
</select>
<input type="submit" name="Submit2" value="前往" class="inputbb"> </td>
</tr>
</form>
</table>
</td>
</tr>
<tr>
<td class="td" align="center" height="20">
<input name="Button" type="button" class="inputbb" onclick=javascript:window.close() value="关闭本窗口">
</td>
</tr>
</table>
</div>
</body>
<%
end if
rs.close%>
</html>