postvote.asp

来自「一个超市管理系统」· ASP 代码 · 共 46 行

ASP
46
字号
<!-- #include file="setup.asp" -->
<%

id=Request("id")

if Request("postvote")="" then
error("<li>请选择,你要投票的项目!")
end if


if instr(Request.Cookies("vote"),""&Request("id")&"|")>0 then
error2("你已经投过票了,无需重复投票!")
end if



sql="select * from forum where id="&Request("id")&""
rs.Open sql,Conn,1,3
for each ho in request.form("postvote")
pollresult=split(rs("pollresult"),"|")
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("pollresult")=allpollresult
rs("lasttime")=now
rs.update
allpollresult=""
next


rs.close
Response.Cookies("vote")=""&Request.Cookies("vote")&""&Request("id")&"|"




error2("投票成功!")


%>

⌨️ 快捷键说明

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