喜力啤酒好喝吗:为什么传递值不变呢??????????????求救阿

来源:百度文库 编辑:神马品牌网 时间:2024/04/20 23:09:10
vote.asp
<%
sql = "Select * From vote "
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 1, 1
i=0
do while not (rs.eof or err)

%>
<form name="form" method="post" action="vote0.asp?id=<%=rs("id")%>">
<table border=1 bordercolor="#99FF99" width="100%" align=center cellspacing=0>
<tr>
<td width="23%" class="STYLE1"><span class="STYLE4">项目:<%=rs("title")%></span></td>
<td width="23%" class="STYLE1"><span class="STYLE4">参与人数:<%=rs("titlenumber")%></span></td>
<td colspan="3" class="STYLE1">编号:<%=rs("id")%></td>
</tr>
<tr>
<td colspan="4" class="STYLE1"><span class="STYLE4">
<input type="radio" name="Options<%=rs("id")%>" value="an" />
</span>a:<span class="STYLE4"><%=rs("a")%></span><span class="STYLE4">   
  
<input type="radio" name="Options<%=rs("id")%>" value="bn" />
</span>b:<span class="STYLE4"><%=rs("b")%></span><span class="STYLE4">   
  
<input type="radio" name="Options<%=rs("id")%>" value="cn" />
</span>c:<span class="STYLE4"><%=rs("c")%></span><span class="STYLE4">   
  
<input type="radio" name="Options<%=rs("id")%>" value="dn" />
</span>d:<span class="STYLE4"><%=rs("d")%></span></td>
<td width="13%" class="STYLE1"><div align="center">
<input type="submit" name="Submit<%=rs("id")%>" value="提交<%=rs("id")%>">
</div></td>
</tr>
<tr>
<%titlenumber=rs("titlenumber")%>
<td height="76" colspan="5" class="STYLE1"><p class="STYLE1">
<%=rs("a")%><img src=redbar.gif width="<%=int(round((rs("an")/titlenumber)*100,10)*2)%>" height=7> <%=rs("an")%>人 占:<%=round((rs("an")/titlenumber)*100,2)%>% <br>
<%=rs("b")%><img src=redbar.gif width="<%=int(round((rs("bn")/titlenumber)*100,10)*2)%>" height=7> <%=rs("bn")%>人 占:<%=round((rs("bn")/titlenumber)*100,2)%>% <br>
<%=rs("c")%><img src=redbar.gif width="<%=int(round((rs("cn")/titlenumber)*100,10)*2)%>" height=7> <%=rs("cn")%>人 占:<%=round((rs("cn")/titlenumber)*100,2)%>%
<label></label>
<br>
<label></label>
<%=rs("d")%><img src=redbar.gif width="<%=int(round((rs("dn")/titlenumber)*100,10)*2)%>" height=7> <%=rs("dn")%>人 占:<%=round((rs("dn")/titlenumber)*100,2)%>% </p></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<p>
<label></label>
<br>
</p>
</form> </td>
为什么vote0.asp?id=<%=rs("id")%>这一句当我提交时id的值一直是1呢

问题可能是因为你的</form>应该在循环体内,应该放在
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
之前,因为你的<form>在循环体内,所以你得到的表单总是第一个表单,所以总是1

do while not (rs.eof or err)
把这句改改do while not rs.eof