<%@ Language=vbscript%>
<%
' The following is an ASP program for processing votes
If Request.ServerVariables ("http_method") = "POST" Then
If Request.Form ("Voteradio") <> "" Then
' Only the user chooses to think that the article is good to continue to write
Set Rec=server. CreateObject ("Adodb.recordset")
Rec. activeconnection= "Dsn=vote"
If Request.Form ("Votecomment") <> "" Then
' Add the user's message to the data
Rec. Source= "SELECT * from Tbcomment"
Rec. Open, 1,3
Tempstr=request.form ("Votecomment")
Rec. AddNew
Rec ("Userip") =request.servervariables ("REMOTE_ADDR")
Rec ("comment") =tempstr
Rec. Update
Rec. Close
Tempstr= "<PRE>" & TempStr & "</PRE>"
Tempstr=tempstr & "<P> You cast a vote, thank you </P>"
Else
' If the user does not have a message, then
Tempstr= "This netizen has nothing to say, he/she just think this article is very good, so cast a vote"
End If
' Update the database that records the polling times according to the user's vote
'????? What if there is no such item???
Rec. Source= "SELECT * from Tbvote where votechapter= '" & Request.Form ("Voteradio") & ""
Rec. Open, 1,3
If Rec. BOF Then
' If the article is the first time to vote, add a new record
Rec. AddNew
Rec ("Votecount") =1
Rec ("Votechapter") =request.form ("Voteradio")
Rec. Update
Else
' Otherwise update the voting count +1
Rec ("Votecount") =rec ("Votecount") +1
Rec. Update
End If
Rec. Close
Set rec=nothing
Else
' This message will appear if no new article is submitted or if the user does not have a choice.
Tempstr= "<PRE>" & "This netizen really strange, all feel bad also vote" & "</PRE>"
End If
Response.Redirect "showmessage.asp?message=" & TempStr
End If
%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<BODY>
</BODY>
</HTML>