Forum Moderators: coopster
I think you can read cookies with the $_COOKIE[] array, and set them using the setcookie [us2.php.net] function.
-sned
<?
if($_COOKIE){
echo "<table>";
foreach($_COOKIE as $c => $v){
echo "<tr><td>".$c."</td><td>".$v."</td></tr>";
}
echo "</table>";
}
?>
<script type="text/javascript">
function setCookie(name, value)
{
document.cookie= name + "=" + escape(value);
}
</script>
name:<input type=text id=name><br>value:<input type=text id=stuff><br><Br>
<br><br>
<form action="<?=$PHP_SELF?>" method=post onSubmit="setCookie(document.all.name.value,document.all.stuff.value);">
<input value=set type=submit></form>
it really has no purpose other than to test the cookies
javascript cookies are set, then the page is reloaded and the php section reads off every set cookie