?? vote.asp
字號:
<!--#include file="../fuction.asp"--><!-- #include file="conn.asp" -->
<%
sub echo(message)
%><script>alert('<%=message%>');history.back();</script><script>window.close();</script>
<% response.end
end sub
%>
<%id=nosql(int(Request("id")))
if Request("menu")="look" then
list=""&Application(CacheName&"vote"&id&"")&""
if list=empty then echo("目前暫時沒有記錄投票的用戶名單!")
echo("參與投票的用戶名單:\n"&list&"")
end if
if session("username")=empty then echo("您必須登錄后才能投票")
if Request("postvote")="" then echo("請選擇,您要投票的項目!")
if instr(Application(CacheName&"vote"&id&""),""&session("username")&" ")>0 or instr(Request.Cookies("vote"),""&id&"|")>0 then echo("您已經投過票了,無需重復投票!")
if instr(Application(CacheName&"voteip"&id&""),""&Request.ServerVariables("REMOTE_ADDR")&" ")>0 then echo("此IP已經投過票了,不能重復投票!")
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from book where id="&id&""
rs.Open sql,Conn,1,3
for each ho in request.form("postvote")
vote_body=split(rs("vote_body"),"|")
for i = 0 to ubound(vote_body)
if not vote_body(i)="" then
if cint(ho)=i then
vote_body(i)=vote_body(i)+1
end if
allpollresult=""&allpollresult&""&vote_body(i)&"|"
end if
next
rs("vote_body")=allpollresult
rs.update
allpollresult=""
next
rs.close
Application(CacheName&"vote"&id&"")=""&session("username")&" "&Application(CacheName&"vote"&id&"")&""
Application(CacheName&"voteip"&id&"")=""&Request.ServerVariables("REMOTE_ADDR")&" "&Application(CacheName&"voteip"&id&"")&""
Response.Cookies("vote")=""&Request.Cookies("vote")&""&id&"|"
Response.Cookies("vote").Expires=date+1
echo("投票成功!")
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -