Forums
This topic is locked
Show region if cookie exists ?
Posted 07 Oct 2002 01:27:29
1
has voted
07 Oct 2002 01:27:29 Berry van Elk posted:
I have a poll voting system, in the poll.asp page I have the voting part and the result part. Now I need to know how I can show the right part depending on a cookie. The voting part appears when the cookie not exists, and the result part appears when the cookie exists. Now I all figured out how I want to do it but I can't find the code.
a example :
< if cookie not exists >
VOTING SYSTEM
< Else if cookie exists >
POLL RESULTS
<end if>
When someone made a vote the page redirect him to a Thankyou.asp page where the page creating the cookie, after 1 second the page redericts him back to the vote page where the results will be shown because the cookie now exists.
This is a idea, now my question is where i can find the right code ? I'v been looking for it by my coding experience is not so well. Can someone give me an example of the show if code / creation cookie code ?
Thank you,
Replies
Replied 07 Oct 2002 11:49:31
07 Oct 2002 11:49:31 Owen Eastwick replied:
In VBScript:
Create a cookie:
<%
Response.Cookies("SomeDomain"("Voted" = "Yes"
%>
Check/Retrieve a value in a cookie:
<% If Request.Cookies("SomeDomain"("Username" = "Yes" Then %>
POLL RESULTS
<% Else %>
VOTING SYSTEM
<% End If %>
More useful information:
www.w3schools.com/asp/asp_cookies.asp
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Create a cookie:
<%
Response.Cookies("SomeDomain"("Voted" = "Yes"
%>
Check/Retrieve a value in a cookie:
<% If Request.Cookies("SomeDomain"("Username" = "Yes" Then %>
POLL RESULTS
<% Else %>
VOTING SYSTEM
<% End If %>
More useful information:
www.w3schools.com/asp/asp_cookies.asp
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 07 Oct 2002 14:23:45
07 Oct 2002 14:23:45 Berry van Elk replied:
Thank you very much, it's working perfectly !