Re: setcookie with array (was serialize)
| From: | Miguel Cruz | Date: | Thu, 28 Mar 2002 18:20:11 +0000 |
| Subject: | Re: setcookie with array (was serialize) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90570@lists.php.net to get a copy of this message | ||
On Thu, 28 Mar 2002, Rodrigo Peres wrote:
> if(isset($submit)) {
> $x = addslashes($HTTP_POST_VARS);
> $y = serialize($x);
> setcookie("posted",$y)
> }
1) You probably should call serialize on the array to turn it into a
string before trying any string transformations like addslashes. If you
don't understand what is going on, help yourself out by printing out the
values every step of the way.
2) You don't need to use addslashes anyway because it has nothing to do
with cookies; they are not quoted.
miguel