<% 'This crap is just used to erase the cookies set by the code below, ignore it... 'Response.Cookies("userVoted")("1") = "" 'Response.Cookies("userVoted")("2") = "" 'Response.Cookies("userVoted")("3") = "" 'Response.Cookies("userVoted").Expires = "December 30, 2036" Set rsRating = Server.CreateObject("ADODB.RecordSet") RatingSql = "SELECT * FROM tbl_KbIndex WHERE ID=" & aID rsRating.Open RatingSql,cString If validateID(aID) = True AND Request.QueryString("step") = "2" AND Request.Cookies("userVoted")(aID) <> "Yes" AND Request.QueryString("message") <> "thankyou" Then userRating = Request.Form("articleRating") curRating = rsRating("articleRating") adoCon.Open cString RatingSql = "UPDATE tbl_KbIndex SET articleRating='" & (curRating + userRating) & "', numRatings=" & (rsRating("numRatings") + 1) & " WHERE ID=" & aID adoCon.Execute(RatingSql) adoCon.Close If Session("adminLoggedIn") <> True Then Response.Cookies("userVoted")(aID) = "Yes" Response.Cookies("userVoted").Expires = "December 30, 2036" End If Response.Redirect("pop_ratearticle.asp?message=thankyou&aID=" & aID & "&newTally=" & Round(((curRating + userRating) / (rsRating("numRatings") + 1)), 1)) ElseIf Request.Cookies("userVoted")(aID) = "Yes" Then %> <%=pageTitle%> - Knowledge Base Search - Rate Article: Error <% Server.Execute("inc_style.asp") %>

<%=pageTitle%>

Sorry, you have already voted for this article!

<% ElseIf validateID(aID) = False Then %> <%=pageTitle%> - Knowledge Base Search - Rate Article: Error <% Server.Execute("inc_style.asp") %>

<%=pageTitle%>

Sorry, the article ID (aID) you entered is not valid!

<% ElseIf Request.QueryString("message") = "thankyou" Then %> <%=pageTitle%> - Knowledge Base Search - Rate Article <% Server.Execute("inc_style.asp") %>

<%=pageTitle%>

<%=Replace(rsRating("articleTitle"), "''", "'")%>

Thanks for voting!  Your vote has been added to the tally, which now stands at <%=Request.QueryString("newTally")%>.

Close this window

<% Else %> <%=pageTitle%> - Knowledge Base Search - Rate Article <% Server.Execute("inc_style.asp") %>

<%=pageTitle%>

Rate an article - <%=Replace(rsRating("articleTitle"), "''", "'")%>

How would you rate this article overall? (1 being the worst and 10 being the best)

<% rsRating.Close Set rsRating = Nothing End If %>