我在投票的过程中,有一个隐藏域ID,总共有13个表单,怎样传递ID号,最好给个原代码,一定给高分!
---------------------------------------------------------------
我刚好做个投票系统,你先在显示的地方:
1<td valign="top">
2<table border="0" bordercolor="#339933" cellpadding="0" cellspacing="0" height="50" width="150">
3<tr align="center" class="1">
4<td class="1" height="15">```
5=rs("changci")
6``` <input ```"="" id")="" name="id" type="hidden" value="```
7=rs("/></td>
8</tr>
9<tr class="1">
10<td height="10"> <input name="team" type="radio" value="3"/>
11<span class="1">胜</span> <input name="team" type="radio" value="1"/>
12<span class="1">平</span> <input name="team" type="radio" value="0"/>
13<span class="1">负</span> </td>
14</tr>
15<tr style="height:20px" valign="middle">
16<td align="center" height="25">
17<input id="submit" name="submit" style="border:1 solid #000000 width:20px;height:20px" type="submit" value="投票"/>
18
19<input ```','','scrollbars="no,width=400,height=200')&quot;" id="view" id")="" name="view" onclick="window.open('list.asp?id=```
20=rs(" style="border:1 solid #000000 width:20px;height:20px" type="button" value="查看"/>
21</td>
22</tr>
23</table>
24</td>
投票VOTE。ASP为:
1@LANGUAGE="VBSCRIPT" CODEPAGE="936"
1
2id=Trim(Request.Form("id"))
3set conn=server.createobject("adodb.connection")
4conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("data/news.mdb")
1
2exec="select * from poll where id="&id&""
3set rs=server.createobject("adodb.recordset")
4rs.open exec,conn,3,2
5if (not rs.eof) then
6select case Trim(Request.Form("team"))
7case 3
8rs("sheng")=rs("sheng")+1
9case 1
10rs("ping")=rs("ping")+1
11case 0
12rs("fu")=rs("fu")+1
13end select
14rs.update
15total=rs("sheng")+rs("ping")+rs("fu")
16if total=0 then
17total=1
1<script language="JavaScript" type="text/JavaScript">
2<!--
3alert("此调查信息为最新调查项目!请进行投票!")
4window.location.href="index.asp";
5//-->
6</script>
1
2end if
3end if
1
2dim pollper(2)
3pollper(0)=cdbl(rs("sheng")/total)
4pollper(1)=cdbl(rs("ping")/total)
5pollper(2)=cdbl(rs("fu")/total)
1<html>
2<head>
3<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
4<title>足彩竞猜</title>
5</head>
6<body>
7<center>
8<table border="0" width="400">
9<tr>
10<td colspan="3">```
11=rs("changci")
12```</td>
13</tr>
14<tr>
15<td width="5%">胜</td>
16<td width="66%">
Response.Write("<img height="15" src="images/bg1.gif" width="& 250*pollper(0) & "/>")
1</td>
2<td align="left" width="29%">```
3=rs("sheng")
4```(```
5= formatpercent(rs("sheng")/total)
6```)</td>
7</tr>
8<tr>
9<td>平</td>
10<td>
Response.Write("<img height="15" src="images/bg1.gif" width="& 250*pollper(1) & "/>")
1</td>
2<td align="left">```
3=rs("ping")
4```(```
5= formatpercent(rs("ping")/total)
6```)</td>
7</tr>
8<tr>
9<td>负</td>
10<td>
Response.Write("<img height="15" src="images/bg1.gif" width="& 250*pollper(2) & "/>")
1</td>
2<td align="left">```
3=rs("fu")
4```(```
5= formatpercent(rs("fu")/total)
6```)</td>
7</tr>
8</table>
9</center>
10</body>
11</html>