Posted by AndreaD on 10/02/02 11:11
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!
[Back to original message]
|