Re: Cookies- peanut butter or chocolate??

From: Date: Thu, 19 Jun 2003 20:38:23 +0000
Subject: Re: Cookies- peanut butter or chocolate??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-152241@lists.php.net to get a copy of this message
Hi, this is an extract from setcookie documentation - how to handle a cookie array. Is this what you were looking for?? You may also set array cookies by using array notation in the cookie name. This has the effect of setting as many cookies as you have array elements, but when the cookie is received by your script, the values are all placed in an array with the cookie's name: setcookie ("cookie[three]", "cookiethree"); setcookie ("cookie[two]", "cookietwo"); setcookie ("cookie[one]", "cookieone"); if (isset ($cookie)) { while (list ($name, $value) = each ($cookie)) { echo "$name == $value<br>\n"; } } ----- Original Message ----- From: "Sparky Kopetzky" <sparkyk@blackmesa-isp.net> To: "PHP General" <php-general@lists.php.net> Sent: Thursday, June 19, 2003 10:10 PM Subject: [PHP] Cookies- peanut butter or chocolate?? Yes, this question is about PHP cookies. Two questions: 1. How do you setup a cookie that will not expire?? 2. How do you put 2 items that you want to save in the cookie and retrieve?? Examples in the PHP manual only show how to work with a single value. Thanks! Robin E. Kopetzky Black Mesa Computers/Internet Services www.blackmesa-isp.net

« previous php.general (#152241) next »