<%
Dim Voteid, Mychoose, I, Rs, SQL
If not IsObject (Conn) Then connectiondatabase
Voteid = CLng (Request ("Voteid"))
If request.cookies ("Vote_" &voteid) = "Newaspvote_" &voteid Then
Response.Write ("&back= has participated in the vote, thank you")
Response.End
Else
Response.Cookies ("Vote_" &voteid) = "Newaspvote_" &voteid
Response.Cookies ("Vote_" &voteid). expires = Date + 3650
Response.Cookies ("Vote_" &voteid). Domain = Request.ServerVariables ("SERVER_NAME")
Mychoose = Split (Request ("Mychoose"), ",",-1, 1)
Set Rs = server. CreateObject ("Adodb.recordset")
SQL = "SELECT * from nc_vote WHERE id =" &voteid
Rs.Open SQL, Conn, 1, 3
If not (RS.BOF and rs.eof) Then
For i = 1 to 5
If mychoose (i-1) = "true" Then
RS ("Choosenum_" &i& "") = RS ("choosenum_" &i& "") + 1
End If
Next
Rs.update
For i = 1 to 5
If mychoose (i-1) = "true" Then
Conn.execute ("UPDATE nc_vote SET votenum=votenum+1 WHERE id=" &rs ("id")
End If
Next
End If
Rs.close
Set Rs = Nothing
Response.Write ("&back= vote has been served, thank you for participating")
End If
Closeconn
%>
This file and to determine whether to vote and to conduct data processing.