Results 1 to 5 of 5

Thread: Save and load information from a cookie.

  1. #1
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Save and load information from a cookie.

    Hi i am trying to make a drop down box with a number of countrys or laguages.

    I would like to save the information in a cookie file. So that the user does not have to put the information in each time they come to the site.

    I would like to cookie to last for 4 week if possible.

    Thanks any help welcome.
    also here is a demo of what i am looking for but i would like it to be ether php or html - http://www.ten.com.au
    The web in one word.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Take a look at this thread:

    http://www.dynamicdrive.com/forums/s...ad.php?t=16544

    this should give you an idea of how to accomplish this. If not, let me know what you've got so far and I will see if I can help you out anymore.

  3. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    If you are looking for a way to handle cookies using JavaScript then I would suggest reading this page.

    It is very useful as it contains three functions which you can use in your case for the following purposes:

    (1) Creating a cookie
    (2) Reading a cookie
    (3) Erasing a cookie

    I found these functions very simple and used in my scripts.

    but i would like it to be ether php or html
    I wonder what is PHP and HTML is doing in JavaScript area of the forum

  4. #4
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    well i thought it would be javascript. But if not thats cool
    The web in one word.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The cookie unit at quirksmode linked to codeexploiter's post and this one is javascript. It works quite well in most situations. But, it is javascript. This means that the user can turn off either javascript or just javascript cookies. It also means that the cookie is stored on the user's machine where he or she can edit or delete it, and where hackers can steal it. There are also PHP cookies - server side cookies and these are better for secure data. In fact, some sort of server side cookie is the only type of cookie that should be used with secure data and then only on a secure server. HTML has no cookies.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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