Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2003
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reading Cookie Values

    Hi,

    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
    else
    draw empty input box
    end if.

    Any ideas? code samples?

    Thanks

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    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.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •