📄 postvote.asp
字号:
<!-- #include file="Setup.asp" -->
<%
id=int(Request("id"))
if Request.Cookies("UserName")=empty then error2("您必须登录后才能投票")
if Request("PostVote")="" then error2("请选择,您要投票的项目!")
sql="select * from [BBSXP_Vote] where ThreadID="&id&""
Rs.Open sql,Conn,1,3
if instr(Rs("BallotUserList"),""&Request.Cookies("UserName")&"|")>0 then error2("您已经投过票了,无需重复投票!")
if Rs("Expiry")< now() then error2("投票已过期")
for each ho in request.form("PostVote")
pollresult=split(Rs("Result"),"|")
for i = 0 to ubound(pollresult)
if not pollresult(i)="" then
if cint(ho)=i then
pollresult(i)=pollresult(i)+1
end if
allpollresult=""&allpollresult&""&pollresult(i)&"|"
end if
next
Rs("Result")=allpollresult
Rs.update
allpollresult=""
next
Rs("BallotUserList")=""&Rs("BallotUserList")&""&Request.Cookies("UserName")&"|"
Rs.update
Rs.close
Conn.execute("update [BBSXP_Threads] set lasttime='"&now()&"',lastname='"&Request.Cookies("UserName")&"' where id="&id&"")
error2("投票成功!")
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -