⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vote.asp

📁 一套很早的多用户电子商务程序
💻 ASP
字号:
<!-- #include file="conn.asp"-->

<%
if request("up")="poll" then
		if session("times")="" then
		vv=request.form("vv")
			if vv<>"" then
			conn.execute("update vote set vcount=vcount+1 where id=cint('"&vv&"')")
			session("times")=now()
			response.write "<script>alert('投票成功,谢谢支持!!');history.back();</script>"
			else
			response.write "<script>alert('您没有选择任何投票项目,请返回后重新输入!');history.back();</script>"
			end if
		else
		response.write "<script>alert('您已经投过票,请不要重复投票!');history.back();</script>"
		end if
else		
%>
<HTML>
<HEAD>
<TITLE>投票</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE>BODY {
	FONT-SIZE: 9pt
}
TD {
	FONT-SIZE: 9pt;
	line-height: 150%;
}

</STYLE>
</HEAD>

<BODY leftmargin="0" topmargin="0">
<TABLE width="98%" border="0" align="center" cellpadding="2" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#ffffff">
  <TR> 
    <TD colspan="4" height="13"><img src="IMAGES/icon2.gif" width="12" height="13"> 
      <strong>调查结果: </strong></TD>
  </TR>
  <TR> 
    <TD colspan="4" align="center" height="14">===============================================================</TD>
  </TR>
  <TR> 
    <TD colspan="4" align="center" height="27"><b><font color="#cc0000"><%=request("up")%></font></b><br> 
      <font color="#666666">目前共有 <font color="#cc0000"> 
      <%
set co=server.createobject("adodb.recordset")
co.open "select sum(vcount) as sm from vote",conn,1,1
	if not co.eof then
	response.write co("sm")
	%>
      </font>人投票</font></TD>
  </TR>
  <%
	set rs=server.createobject("adodb.recordset")
	rs.open "select * from vote",conn,1,1
		if not rs.eof then
		do while not rs.eof
		i=i+1
		%>
  <TR> 
    <TD width="36%"><%=i%>、<%=rs("vname")%></TD>
    <TD width="40%"><img src="IMAGES/ba.gif" border="0" width="<%=left((rs("vcount")/co("sm"))*100,3)%>" height="10">&nbsp;<font color="#666666">(</font><font color="#cc0000"><%=rs("vcount")%></font><font color="#666666">人)</font></td>
    <td width="24%" align="center" class="css">&nbsp;<%=formatnumber((rs("vcount")/co("sm"))*100,1)%>%</TD>
  </TR>
  <%
		rs.movenext
		loop
		end if
	rs.close:set rs=nothing
	end if
co.close
set co=nothing
end if
%>
  <TR> 
    <TD colspan="4" align="center" height="14">================================================================</TD>
  </TR>
</TABLE>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -