#1
  1. No Profile Picture
    PhOrPhEr
    Guest
    Devshed Newbie (0 - 499 posts)
    How can I detect if the visitors browser accepts cookies in PHP3?

    I'm doing a vote script and I want to use a cookie to check if the user have voted before.

    Thanks.
  2. #2
  3. No Profile Picture
    Stefan Filipiuk
    Guest
    Devshed Newbie (0 - 499 posts)
    lo1


    First You send a _TEST-COOKIE_ to the Client and request it in the 2nd step.

    eg:
    [html head start]

    <?php
    setcookie("CHECK", "OK");
    ?>

    [html head end]

    <?php
    if (!$HTTP_COOKIE_VARS["CHECK"]) {
    no cookie lines here ...;
    } else {
    cookiesupport lines here ...;
    }
    ?>


    I hope I could hep You.
    bibi
  4. #3
  5. No Profile Picture
    PhOrPhEr
    Guest
    Devshed Newbie (0 - 499 posts)
    Thanks for your help but I already solved the problem.

    The problem with cookies(as far as I know) is that you have to refresh to see your test cookie.

    Thanks anyway.

    /PhOrPhEr
  6. #4
  7. No Profile Picture
    pandemus
    Guest
    Devshed Newbie (0 - 499 posts)
    Can you share your voting script with me, or is it too much to ask?

    Thanks
  8. #5
  9. No Profile Picture
    PhOrPhEr
    Guest
    Devshed Newbie (0 - 499 posts)
    No, sorry.

    It isn't that hard to make one yourself...

Similar Threads

  1. Replies: 6
    Last Post: February 8th, 2004, 04:27 PM
  2. I can't get rid of my browser cookies, plz help
    By lilli151 in forum Beginner Programming
    Replies: 9
    Last Post: December 9th, 2003, 02:00 PM
  3. browser settings with cookies
    By Andrew_Smart in forum PHP Development
    Replies: 8
    Last Post: November 19th, 2003, 06:29 PM
  4. Clearing all cookies php script - HowTo?
    By fordfasterr in forum PHP Development
    Replies: 8
    Last Post: October 24th, 2003, 09:40 AM
  5. problem accessing browser over network
    By -Dman100- in forum Networking Help
    Replies: 0
    Last Post: October 22nd, 2003, 07:49 PM

IMN logo majestic logo threadwatch logo seochat tools logo