最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
简单asp投票系统源码
时间:2010-11-01 编辑:简简单单 来源:一聚教程网
本文章 一款简单asp教程投票系统源码,同时可以判断用户是否是当天第一次投票,如果不是就提示感谢您的支持,您已经投过票了,谢谢,否则就增加投票资料,并且把用户的ip地址保存到cookies里面,这样可以判断用户是否投票了。
<%dim options,total,sql,i,answer
if request.querystring("stype")="" then
if request.servervariables("remote_addr")=request.cookies("ipaddress") then
response.write""
else
options=request.form("options")
response.cookies("ipaddress")=request.servervariables("remote_addr")
conn.execute("update vote set answer"&options&"=answer"&options&"+1 where ischecked=1")
end if
end if
%>投票结果
css教程.css rel=stylesheet>
投票结果
ps教程e: collapse" align="center">
<%
total=0
set rs=server.createobject("adodb.recordset")
sql="select * from vote where ischecked=1"
rs.open sql,conn,3,3
%>
==================www.111com.net=======================
<%=rs("title")%>
序号
百比分
人数
<%
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
%>
<%=i%>.<%=rs("select"&i)%>:
height=8>
<%=round(answer,3)%>%
<%=rs("answer"&i)%>人
<%
end if
next
%>
共有【<%=total%>】人参加投票
=======================================================
【关闭窗口】
<% rs.close
set rs=nothing
conn.close
set conn=nothing %>
-
上一个: asp用户登录,退出登录函数
-
下一个: asp 返回一个路径的目录名与父路径
相关文章
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16
- asp中获取日期为星期几的技巧 09-14