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

📄 vote.asp

📁 很好的代码!!大家可以下
💻 ASP
字号:
<% Response.Buffer=True %> 
<!--#include file="conn.asp"--><!--#include file="char.inc"-->
<!--#include file="../include/config.asp"-->
<%
if request.QueryString("stype")="" then
	if Request.ServerVariables("REMOTE_ADDR")=request.cookies("IPAddress") then
		response.write"<SCRIPT language=JavaScript>alert('感谢您的支持,您已经投过票了,请勿重复投票,谢谢!');"
		response.write"javascript:window.close();</SCRIPT>"
	else
		options=request.form("options")
		response.cookies("IPAddress")=Request.ServerVariables("REMOTE_ADDR") 
		set rs=server.createobject("adodb.recordset")
		sql="update vote set answer"&options&"=answer"&options&"+1 where IsChecked=1"
		rs.open sql,conn,1,3
		set rs=nothing
	end if
end if
%><head>
<title>投票结果</title>
<LINK href=site.css rel=stylesheet>
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {font-size: 14pt}
.style3 {font-size: 14}
body {
	background-color: #F4f4f4;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>


<body >


<div align="center">
  <center>
  <table width="98%" height="48" border="0" cellpadding="0" cellspacing="1" bordercolor=<%=border%>     background="guang/mybg.gif"           style="border-collapse: collapse">
    <%
total=0
set rs=server.createobject("adodb.recordset")
sql="select * from vote where IsChecked=1"
rs.open sql,conn,1,1
%>
    <tr align="center" valign="middle" bgcolor="#E8E8E8"> 
      <td height="24" colspan="4"><span class="style2"><span class="style3"><font color="#000000">『</font><span class="style1"><%=rs("Title")%></span></span></span><span class="style3"><font color="#000000">』投票结果</font><font color="#000000"></font></span><font color="#000000"><br>
      </font> </td>
    </tr>
    <tr valign="middle" bgcolor="#FFFFFF">
      <td colspan="4"><div align="center"><font color="#000000"><br>
        </font> </div></td>
    </tr>
    <tr valign="middle" bgcolor="#F2F2F2"> 
      <td width="38%" height="26"><div align="center">序号</div></td>
      <td><div align="center">图像百分比</div></td>
      <td align="center"><div align="center">数字百分比</div></td>
      <td align="center">人数</td>
    </tr>
    <%
for i=1 to 8
	if rs("Select"&i)<>"" then
		total=total+rs("answer"&i)
	end if
next

%>
    <%for i=1 to 8
	if rs("Select"&i)<>"" then
		if total=0 then
			answer=0
		else
			answer=(rs("answer"&i)/total)*100
		end if
%>
    <tr valign="middle" bgcolor="#FFFFFF"> 
      <td height="22" bgcolor="#FFFFFF"> <%=i%>.<%=rs("select"&i)%></td>
      <td width="38%"><img src=images/RSCount.gif width=<%=int(answer*2)%> height=8></td>
      <td width="12%" bgcolor="#FFFFFF"><div align="center"><%=round(answer,3)%>%</div></td>
      <td width="12%" bgcolor="#FFFFFF"><div align="center"><%=rs("answer"&i)%>人</div></td>
      <%
	end if
next
%>
    <tr valign="middle" bgcolor="#FFFFFF"> 
      <td height="26" colspan="4"> <div align="center">共有【<%=total%>】人参加投票</div></td>
    </tr>
    <tr valign="middle" bgcolor="#FFFFFF">
      <td height="26" colspan="4"><div align="center">【<a href="../guestbook.asp" target="_blank">留下建议</a>】【<a href="javascript:window.close()">关闭窗口</a>】
          <% rs.close     
set rs=nothing     
conn.close     
set conn=nothing %>
      </div></td>
    </tr>
  </table>  
</div>  

⌨️ 快捷键说明

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