View Full Version : Reading Cookie Values

04-01-2003, 06:06 PM

I have a form that holds customer details - name, address, tel no etc. When the form posts it writes a cookie holding this info.

What I would like to know is, if the user comes back to the form with the customer details on how can i get it to write the values from the cookie in, or if no cookie exists it will show empty form fields.

Think an If statement would be needed but unsure how to do it in PHP.

If the user has a cookie then
fill value in input box
draw empty input box
end if.

Any ideas? code samples?


04-01-2003, 06:09 PM
Have you considered using sessions instead? They are a bit easier to work with and more reliable and secure than storing the data on the users computer.