% dim Action,ID,VoteType,VoteOption,sqlVote,rsVote Action=trim(Request("Action")) ID=Trim(request("ID")) VoteType=Trim(request("VoteType")) VoteOption=trim(request("VoteOption")) If Action = "Vote" And Id<> "" And VoteOption<>"" Then if VoteType="Single" then conn.execute "Update Vote set answer" & VoteOption & "= answer" & VoteOption & "+1 where ID=" & ID else dim arrOptions if instr(VoteOption,",")>0 then arrOptions=split(VoteOption,",") dim i for i=0 to ubound(arrOptions) conn.execute "Update Vote set answer" & cint(trim(arrOptions(i))) & "= answer" & cint(trim(arrOptions(i))) & "+1 where ID=" & Clng(ID) next else conn.execute "Update Vote set answer" & VoteOption & "= answer" & VoteOption & "+1 where ID=" & Clng(ID) end if end if session("Voted")="True" End If if ID<>"" then sqlVote="Select * from Vote Where ID=" & Clng(ID) else sqlVote="select top 1 * from Vote order by ID desc" end if Set rsVote = Server.CreateObject("ADODB.Recordset") rsVote.open sqlVote,conn,1,1 %>
<%
if Action="Vote" then
response.write ""
if Session("UserName")<>"" then response.write Session("UserName") & ":"
response.write " 非常感谢您的投票! " end if %>
【关闭窗口】 |