I'm running a basic survey using the code below followed by a form:
<%
If Request.Form("submit") = "Submit" Then
' Ensure there is some content
If Len(Trim(Request.Form("Q1")) & Trim(Request.Form("Q2")) & Trim(Request.Form("Q3")) & Trim(Request.Form("Q4")) & Trim(Request.Form("Q5")) & Trim(Request.Form("Q6"))) > 0 Then
set cn=server.createobject("adodb.connection")
strConnect = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/dbase/poll/CapitalPunishment.mdb")
cn.open(strConnect)
Set rs = Server.CreateObject("ADODB.RecordSet")
strSQL = "SELECT * FROM Results"
rs.Open strSQL,cn,3,3
rs.AddNew
rs("Question1") = Request.Form("Q1")
rs("Question2") = Request.Form("Q2")
rs("Question3") = Request.Form("Q3")
rs("Question4") = Request.Form("Q4")
rs("Question5") = Request.Form("Q5")
rs("Question6") = Request.Form("Q6")
rs.Update
rs.Close
cn.Close
Set cn = Nothing
mode = "thankyou"
End If
End If
%>
I'd like to be able to set a cookie upon 'submit' of the form which will be checked if the person returns to this page. If they have the cookie (meaning they've submitted their response already) they should then see the 'thank you' version of the page rather than the form. What is the easiest way to do this?
Thanks!