mcslemon
05-06-2003, 03:31 AM
Hello.
I'm running a survey. When the person looks at the survey, the page writes a cookie to say they've completed the survey. Thing is, once they have done it they can click back and do it again. I need to stop this. I've used the following code to check for the cookie but I'm not sure if its correct.
<%
Response.Buffer = True
Dim strCookieName
strCookieName = CStr("SurveyCompleted")
if strCookieName <> "SurveyCompleted" then
%>
at the end of the code there is:
<%
else
response.redirect="webaddress"
end if
%>
This part follows if the cookie isn't there. Basically creating the cookie if they've not done the survey and allowing them to continue.
<%
Response.Cookies("SurveyCompleted") = CStr(Now)
Response.Cookies("SurveyCompleted").Expires = "Jun 1, 2003"
%>
*******survey continues***********
Is this code correct?
Neil.
I'm running a survey. When the person looks at the survey, the page writes a cookie to say they've completed the survey. Thing is, once they have done it they can click back and do it again. I need to stop this. I've used the following code to check for the cookie but I'm not sure if its correct.
<%
Response.Buffer = True
Dim strCookieName
strCookieName = CStr("SurveyCompleted")
if strCookieName <> "SurveyCompleted" then
%>
at the end of the code there is:
<%
else
response.redirect="webaddress"
end if
%>
This part follows if the cookie isn't there. Basically creating the cookie if they've not done the survey and allowing them to continue.
<%
Response.Cookies("SurveyCompleted") = CStr(Now)
Response.Cookies("SurveyCompleted").Expires = "Jun 1, 2003"
%>
*******survey continues***********
Is this code correct?
Neil.