Forum Moderators: open
When a person comes to my site, they have the option of entering their name and other info. into a form. When they click submit I want to be able to save their name to a cookie. How do I get the information from the form and set it in a cookie?
dreaming of nascar
Response.Cookies("item_name") = Request("value from form")
Response.Cookies("item_name").domain = "your domain name"
Response.Cookies("item_name").path = "directory it applies to"
Response.Cookies("item_name").expires = #date#
(You need to update all the values if you want to update the cookie later.)
Thanks.
a simple
<%
Response.Cookies(Mywebsite)(name) = Request.Form("name")
Response.Cookies(Mywebsite)(email) = Request.Form("email")
Response.Cookies(Mywebsite(age) = Request.Form("age")
Response.Cookies(Mywebsite).Expires Now()+365
%>
This will create a cookie on the clients pc and store the values of their name, email, and age.
Maybe you dont want to go down the ASP road but when you are making your pages interactive then you should prob consider a langauge like ASP,PHP,JSP for the future.