note 51586 rejected from function.setcookie by betz
| From: | betz@php.net | Date: | Tue, 05 Apr 2005 07:44:01 +0000 |
| Subject: | note 51586 rejected from function.setcookie by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-87480@lists.php.net to get a copy of this message | ||
Note Submitter: simul at yahoo dot com
----
I use the following code but that show error
Parse error: parse error in c:\apache\htdocs\cookies\c.php on line 10
<?php
// set the cookies
setcookie("cookie[three]", "cookiethree");
setcookie("cookie[two]", "cookietwo");
setcookie("cookie[one]", "cookieone");
// after the page reloads, print them out
if (isset($_COOKIE['cookie']))
{
foreach ($_COOKIE['cookie'] as $name => $value)
{ echo "$name : $value <br />\n"; }
}
?>