(高分寻ASP高手)关于option返还值问题
以下程序是实现当在OPTION里选择章数后就在该页面显示出数据库的相应的章数的记录.但我运行时选择章数后页面不变,应该怎样修改呢?(请写得详细点)<!--#INCLUDE...
以下程序是实现当在OPTION里选择章数后就在该页面显示出数据库的相应的章数的记录.但我运行时选择章数后页面不变,应该怎样修改呢?
(请写得详细点)
<!--#INCLUDE file="../conn.asp" -->
<head>
<title> 在线练习系统---习题</title></head>
<%
if Request.Form("timea")=1 then
Response.Write "时间已到。"
end if
%>
<form action="../exercise.asp" method="post" >
<select name="zhangshu" size="1">
<%
dim a(20),j
for j=0 to 11
a(j)=j+1
response.write "<option value="&a(j)&">"&"第"&a(j)&"章"&"</option>"
next
%>
</select>
</form>
<%
zhangshu=trim(request("zhangshu"))
rs.open sql,conn,3,3
do while not rs.eof
rs.update
rs.movenext
loop
rs.close
sql="select * from test where zhangshu='"&zhangshu&"'"
Set rs = conn.Execute(sql)
%>
<FORM action="../stry_result.asp" id=FORM1 method=post name=FORM1>
<tr>
<td>
<span class="style2">单选题:</span>
<%
i=1
rs.movefirst
do while not rs.eof
%>
</span><TABLE width="768" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD height="35" bgcolor="#EFEFEF"><span class="unnamed18high"><span class="style1"> &_
第</span><%=rs("id")%><span class="style1">题:</span><%=rs("question")%></span></TD>
</TR>
<td><input name=ans<%=i%>
type=radio value="A">
A. <%=rs("A")%> </td>
</tr>
<tr>
<td><input name=ans<%=i%>
type=radio value="B" >
B. <%=rs("B")%> </td>
</tr>
<tr>
<td><input name=ans<%=i%>
type=radio value="C" >
C. <%=rs("C")%> </td>
</tr>
<tr>
<td><input name=ans<%=i%>
type=radio value="D" >
D. <%=rs("D")%> </td>
</tr>
<%
i=i+1
rs.movenext
loop
%>
</td>
</tr>
<input name=submit1 type=submit id=submit1 value="交卷">
<input id=reset1 name=reset1 type=reset value="重填">
</FORM> 展开
(请写得详细点)
<!--#INCLUDE file="../conn.asp" -->
<head>
<title> 在线练习系统---习题</title></head>
<%
if Request.Form("timea")=1 then
Response.Write "时间已到。"
end if
%>
<form action="../exercise.asp" method="post" >
<select name="zhangshu" size="1">
<%
dim a(20),j
for j=0 to 11
a(j)=j+1
response.write "<option value="&a(j)&">"&"第"&a(j)&"章"&"</option>"
next
%>
</select>
</form>
<%
zhangshu=trim(request("zhangshu"))
rs.open sql,conn,3,3
do while not rs.eof
rs.update
rs.movenext
loop
rs.close
sql="select * from test where zhangshu='"&zhangshu&"'"
Set rs = conn.Execute(sql)
%>
<FORM action="../stry_result.asp" id=FORM1 method=post name=FORM1>
<tr>
<td>
<span class="style2">单选题:</span>
<%
i=1
rs.movefirst
do while not rs.eof
%>
</span><TABLE width="768" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD height="35" bgcolor="#EFEFEF"><span class="unnamed18high"><span class="style1"> &_
第</span><%=rs("id")%><span class="style1">题:</span><%=rs("question")%></span></TD>
</TR>
<td><input name=ans<%=i%>
type=radio value="A">
A. <%=rs("A")%> </td>
</tr>
<tr>
<td><input name=ans<%=i%>
type=radio value="B" >
B. <%=rs("B")%> </td>
</tr>
<tr>
<td><input name=ans<%=i%>
type=radio value="C" >
C. <%=rs("C")%> </td>
</tr>
<tr>
<td><input name=ans<%=i%>
type=radio value="D" >
D. <%=rs("D")%> </td>
</tr>
<%
i=i+1
rs.movenext
loop
%>
</td>
</tr>
<input name=submit1 type=submit id=submit1 value="交卷">
<input id=reset1 name=reset1 type=reset value="重填">
</FORM> 展开
1个回答
展开全部
<%
zhangshu=trim(request("zhangshu"))
sql="select * from test"
rs.open sql,conn,3,3
do while not rs.eof
rs.update
rs.movenext
loop
rs.close
'sql="select * from test order by id"'提取试题 desc意思从大到小
sql="select * from test where zhangshu='"&cstr(request.form("zhangshu"))&"'order by id desc"
Set rs = conn.Execute(sql)
' rs.moveprevious
%><head>
</head>
<form action="exercise.asp" method="post" >
<select name="zhangshu" size="1">
<%
dim a(20),j
for j=0 to 11
a(j)=j+1
response.write "<option value="&a(j)&">"&"第"&a(j)&"章"&"</option>"
next
%>
</select>
<input name="" type="submit" value="选择">
<span class="unnamed11">(选择章数后,请点击"选择"按钮)</span> </form>
zhangshu=trim(request("zhangshu"))
sql="select * from test"
rs.open sql,conn,3,3
do while not rs.eof
rs.update
rs.movenext
loop
rs.close
'sql="select * from test order by id"'提取试题 desc意思从大到小
sql="select * from test where zhangshu='"&cstr(request.form("zhangshu"))&"'order by id desc"
Set rs = conn.Execute(sql)
' rs.moveprevious
%><head>
</head>
<form action="exercise.asp" method="post" >
<select name="zhangshu" size="1">
<%
dim a(20),j
for j=0 to 11
a(j)=j+1
response.write "<option value="&a(j)&">"&"第"&a(j)&"章"&"</option>"
next
%>
</select>
<input name="" type="submit" value="选择">
<span class="unnamed11">(选择章数后,请点击"选择"按钮)</span> </form>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询