室外灯箱材质:有谁知道用ASP制作网上调查的代码呀!

来源:百度文库 编辑:神马品牌网 时间:2024/05/08 22:08:39
例:
网上调查:
您对本网站是否满意:
满意(单选按扭)
非常满意(单选按扭)
不满意(单选按扭)
非常满意(单选按扭)
提交 查看
我想让查看反出来的是百分比的形式

<center><font color="#000080">欢迎您参与投票!</font></center>
<table width="468" height="110" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000066">
<tr>
<td height="155" width="745">
<table width="532" border="0" cellpadding="0" cellspacing="0" height="231">
<tr bgcolor="#FFFFCC">
<td height="24" colspan="3" bgcolor="#FFFFFF" style="border:1 solid #F7F7FF">
<form method="post" action="adddata.asp" name="research">
<p align="left" style="line-height:200%; margin-top:1;margin-bottom:1"><b>
<font color="#003366">动态网站制作最重要的技术是?</font>
</b>
</p>
<p align="left" style="line-height:200%;margin-top:1;margin-bottom:1">

<input type="radio" value="a" name="options" checked>
<font color="#000080"></font><font color="#000080">Dreamweaver</font>
<input type="radio" value="b" name="options">
<font color="#000080">ASP</font>
<input type="radio" value="c" name="options">
<font color="#000080">Frontpage</font>
<input type="radio" value="d" name="options">
<font color="#000080">数据库</font></p>

<div align="center"><br>

<input type="submit" value="投票" name="cmdok2" class="p9" style="background-color:
rgb(145,148,195);color:rgb(255,255,255)">(每人限投一次) </div>
<p></p>
</form>
</td>
</tr>

<tr bgcolor="#FFFFCC">
<td width="168" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<img border="0" src="bar1.gif" width="16" height="18">
<font color="#000080">Dreamweaver</font>
</td>
<td width="110" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<font color="#0000CC">有<font color="#FF3333"><%=rs("selecta")%></font>人投票</font>
</td>

<td width="93" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF"><font color="#FF3333">占:<%=Round(selecta,2)%>%</font>
</td>
</tr>

<tr bgcolor="#FFFFCC">
<td width="168" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<img border="0" src="bar2.gif" width="16" height="18">
<font color="#000080">ASP</font>
</td>
<td width="110" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<font color="#0000CC">有<font color="#FF3333"><%=rs("selectb")%></font>人投票</font>
</td>

<td width="93" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF"><font color="#FF3333">占:<%=Round(selectb,2)%>%</font>
</td>
</tr>

<tr bgcolor="#FFFFCC">
<td width="168" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<img border="0" src="bar3.gif" width="16" height="18">
<font color="#000080">Frontpage</font>
</td>
<td width="110" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<font color="#0000CC">有<font color="#FF3333"><%=rs("selectc")%></font>人投票</font>
</td>

<td width="93" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF"><font color="#FF3333">占:<%=Round(selectc,2)%>%</font>
</td>
</tr>

<tr bgcolor="#FFFFCC">
<td width="168" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<img border="0" src="bar4.gif" width="16" height="18">
<font color="#000080">数据库</font>
</td>
<td width="110" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<font color="#0000CC">有<font color="#FF3333"><%=rs("selectd")%></font>人投票</font>
</td>

<td width="93" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF"><font color="#FF3333">占:<%=Round(selectd,2)%>%</font>
</td>
</tr>

<td width="168" height="24" style="border:1 solid #F7F7FF" bgcolor="#FFFFFF">
<font bgcolor="#FF0000">@</font><font color="#000080">参加投票人数: </font>
</td>
<td bgcolor="#FFFFFF" height="24" width="110" style="border: 1 solid #F7F7FF">
<font color="0000CC">目前共有<font color="#FF3333"><%=total%></font>人投票</font></td>
<td bgcolor="#FFFFFF" height="24" width="92" style="border: 1 solid #F7F7FF">
<font color="#FF3333">谢谢参与!</font></td>

<%
Else
response.write "还没有人参加调查"
End If
rs.close
Set rs=Nothing
con.close
Set con=Nothing
%>

</table>
这是自己写的代码中的一段,你可以参考参考~~希望对你有所帮助

取投票人的总数在除也各个投票数