ASP Voting System II

Source: Internet
Author: User

<%
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.