spot the mistake??
| From: | AndreaD | Date: | Tue, 22 Mar 2005 10:58:22 +0000 |
| Subject: | spot the mistake?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211280@lists.php.net to get a copy of this message | ||
this is the form
form name="form1" method="post" action="<? $PHP_SELF; ?>">
<table width="515" border="1">
<tr>
<td width="87"><div align="center">
<input name="cookie[andrea]" type="text" class="text_field"
id="cookie[andrea]" value="" size="1" maxlength="1" >
<input name="cookie[john]" type="text" class="text_field"
id="cookie[andrea]" value="" size="1" maxlength="1" >
</div></td>
this is the php
<?php
if (isset($submitted)){
foreach($_POST['cookie'] as $name => $age)
{
setcookie("cookie[$name]", $age);
}
foreach($_POST['cookie'] as $name => $age)
{
echo $_COOKIE[$name];
}
}
?>
just want to set the cookies and display them!