ASP and "if" statement using cookies?

Sam

New member
Please help !

i have a page where a list of statements are made. each statement can have a positive or negative answer in format of a "plus" or a "minus" response.

in the database the fields are text and are incremented by a negative or positive number.

in oder to prevent the same person clicking twice on the same item i need to read and or inject a cookie to see if he has previously responded to each item

here is my code and this is where my technical ASP skills came tumbling down

<%
url = Request.QueryString("id")
##################################################
requesting the id of the statement
##################################################


fname = Request.Cookies("TwitPlus")
##################################################
to read a cookie if there is one ? and to see if the cookie exist ?
##################################################


if fname = url then
##################################################
HELP HELP HELP
How do i identfy and compare this ID with a cookie if it existys and if it does how do i reject his path and let him go back to the default page
##################################################



set conn = Server.CreateObject("ADODB.Connection")
conn.open Conn_String
Set RS = conn.Execute("select * from Table_Contacts where Twit_ID =" & url)
hit=cInt(rs("Twit_Main_Vote_Plus"))+1
Set RS2 = conn.Execute("UPDATE Table_Contacts SET Twit_Main_Vote_Plus = " & hit & " Where Twit_ID =" & url)
RS.Close
conn.Close
set conn = nothing
##################################################
my code incrementing the number in the field
this work okay without my jumbled cookie code
##################################################


Response.Cookies("TwitPlus") = "TwitPlus" & Twit_ID
Response.Cookies("TwitPlus").Expires=#May 10,2020#
##################################################
here i write a cookie if he has not made his vote on this stament
##################################################

Response.Redirect "default.asp"
else
##################################################
here i redirect him back to0 the page
##################################################

Response.Redirect "default.asp"
end if
##################################################
here i redirect him back to the page
##################################################

%>
 
Back
Top