Re: [PHP] array in cookie . . .

2001-03-26 Thread Christian Reiniger

On Monday 26 March 2001 05:15, you wrote:
 Im trying to get an array saved in a cookie, I have this snippet so
 far..

 ?
 if (newuser == yes) {
$user_reg[0]= $username;
$user_reg[1]= $password;
$user_reg[2]= $fullname;
$user_reg[3]= $email;
$user_reg[4]= $age;
 setcookie ("user_reg" , $user_reg, time() + 360 * 86400);

use serialize($user_reg). You can only save strings in cookies.

 is there a limit to how much I can save in the array ?

IIRC 8192 bytes

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

Google results 1-10 of about 142,000,000 for e. Search took 0.18 seconds.

- http://www.google.com/search?q=e

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] array in cookie . . .

2001-03-25 Thread PHPretard

Im trying to get an array saved in a cookie, I have this snippet so far..

?
if (newuser == yes) {
   $user_reg[0]= $username;
   $user_reg[1]= $password;
   $user_reg[2]= $fullname;
   $user_reg[3]= $email;
   $user_reg[4]= $age;
setcookie ("user_reg" , $user_reg, time() + 360 * 86400);
   $done_message = "thankyou, $user_reg[0].";
}else{
  $done_message = $sign_form;
}
?

$username and the others vars are coming from a form submitted.
did I write this ok?

is there a limit to how much I can save in the array ?

Thanx 

amd


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]