#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    8
    Rep Power
    0
    Hey, I really need help with the setcookie thing.

    Ive seen it at some places, but I never understand what everything is.

    Lets say I wanted a cookie to last for a year, and I wanted it to contain a variable. The variable is: $color=blue;

    My domain name is Gamethrust.com.

    Could someone make this cookie, and maybe explain what everything does?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    32
    Rep Power
    15
    You shuold really check out www.php.net if you know the function you want. They describe everything quite clearly, but I'll post it here for you

    $variable_name = "color";
    $variable_value = "blue";
    $expire_time = time() + (60 * 60 * 24 * 365);
    $domain = "www.Gamethrust.com";

    setcookie("$variable_name","$variable_value",$expire_time,"$domain");

    The variable names should be enough explanation, no?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    8
    Rep Power
    0
    Thanks a lot!!!

Similar Threads

  1. Placing user-entered data into cookie
    By Tyrone in forum Perl Programming
    Replies: 2
    Last Post: February 17th, 2004, 05:31 PM
  2. mssql prob. plz help
    By shawon in forum PHP Development
    Replies: 1
    Last Post: May 6th, 2003, 10:25 AM
  3. session or cookie with mysql prob
    By Z BO in forum PHP Development
    Replies: 3
    Last Post: October 16th, 2002, 09:48 PM
  4. Killing a cookie.... Help plz
    By Stenyjj in forum Perl Programming
    Replies: 1
    Last Post: July 19th, 2002, 02:34 AM
  5. Per session cookie expiration
    By csaba in forum PHP Development
    Replies: 4
    Last Post: June 21st, 2002, 10:54 PM

IMN logo majestic logo threadwatch logo seochat tools logo