#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    49
    Rep Power
    15
    may i know how could i set and get the cookie with variable name?
  2. #2
  3. No Profile Picture
    a total freak
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    33
    Rep Power
    15
    its as simple as:

    setcookie("name_of_cookie","value_of_cookie");

    actually, theres more to the function of setcookie,.. you can set the expire time and stuff.. but, i just damn forgot, since i rarely set expire dates..

    getting the cookie is as simple as declaring the variable or the name_of_cookie as a variable such as:

    setcookie("mycookie","chocolatechip");

    you can do:

    print $mycookie;

    and it'll show chocolatechip..

    ------------------
    ---freakyG!---
    kinumedia, web developer
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    49
    Rep Power
    15
    what i means is the name of the cookie is a variable(can be change or may be changing with time) and not the static.
    i am sorry because u may misunderstanding.
    can somebody help me to solve this problem? thanks.
  6. #4
  7. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    cskoo,
    that should be possible.

    But one thing you should remember is that what name you are giving to your cookies through that varible.

    eg:

    <?php
    $cookienames="shiju";
    setCookie($cookienames,"cookie value");
    echo $shiju;
    ?>




    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

    [This message has been edited by Shiju Rajan (edited July 04, 2000).]

Similar Threads

  1. Placing user-entered data into cookie
    By Tyrone in forum Perl Programming
    Replies: 2
    Last Post: February 17th, 2004, 04:31 PM
  2. A variable $_POST variable?
    By CLuver in forum PHP Development
    Replies: 0
    Last Post: February 11th, 2004, 12:55 AM
  3. How to read multiple line text file into a variable
    By gatewaycityca in forum Visual Basic Programming
    Replies: 4
    Last Post: January 29th, 2004, 12:26 PM
  4. Using session variables instead of cookie variable
    By sargent1 in forum PHP Development
    Replies: 1
    Last Post: January 24th, 2004, 04:29 PM
  5. Replies: 5
    Last Post: November 16th, 2003, 11:31 AM

IMN logo majestic logo threadwatch logo seochat tools logo