#1
  1. No Profile Picture
    toddboland
    Guest
    Devshed Newbie (0 - 499 posts)
    I really am having trouble with setting this simple cookie. Any help would GREATLY be appreciated.
    <?
    $iscookie=$CartCookie;
    $value=md5(uniqid(""));
    if ($iscookie == "") {
    SetCookie("CartCookie",$value,"time()+3600","/Cart","www.mydomain.com",0);
    echo "$CartCookie";
    echo "<i>$value</i>";
    $test = "$HTTP_COOKIE_VARS[CartCookie]";
    echo "<b>$test</b>";
    exit;
    } else {
    echo "Blah";
    }
    ?>
  2. #2
  3. No Profile Picture
    toddboland
    Guest
    Devshed Newbie (0 - 499 posts)
    I almost forgot to tell you my problem, I cant get the line:
    $test = "$HTTP_COOKIE_VARS[CartCookie]";
    echo "<b>$test</b>";
    to return the value of the cookie
    thanx in advance
  4. #3
  5. No Profile Picture
    timbo
    Guest
    Devshed Newbie (0 - 499 posts)
    I'm not entirely sure what you are doing but if you do this

    <?
    $value=md5(uniqid(""));
    if (!$CartCookie) {
    SetCookie("CartCookie",$value,time()+3600);
    }
    echo "<i>$value</i><br>";
    echo $CartCookie;
    ?>
    <html>
    <title>

    </title>
    <body>
    </body>
    </html>

    it will test for your cookie and add if necessary, and print it on the page so you can see it. One of the problems was the actual setting of the cookie (in the SetCookie syntax).
    Not sure if that helped or not, give us a shout if you have any more probs with it

    ------------------
    cheers

Similar Threads

  1. windows XP chkdsk and file system problems
    By wey97 in forum Windows Help
    Replies: 26
    Last Post: August 2nd, 2005, 11:37 PM
  2. Popup problems from Flash in IE6
    By jmichels in forum Flash Help
    Replies: 19
    Last Post: January 6th, 2004, 03:27 PM
  3. setcookie function problems
    By benthekiller in forum PHP Development
    Replies: 10
    Last Post: September 30th, 2003, 03:51 AM
  4. Replies: 0
    Last Post: August 26th, 2003, 07:50 PM
  5. Windows problems
    By Known_criminal in forum Windows Help
    Replies: 0
    Last Post: August 23rd, 2003, 07:23 PM

IMN logo majestic logo threadwatch logo seochat tools logo