Okay, i'm trying to learn how to use cookies. So here's my problem. To learn, i'm trying to make a page that will display the information on the cookie, and let the user change if they desire, so it would have to re-write the cookie on the refresh. but it doesnt write it and I dont know why plus the book i'm using doesnt go much into it. here's the code:
<?php
if ($fontcolor) setcookie ("fontcolor", $fontcolor, time()+3600);
if ($layercolor) setcookie ("layercolor", $layercolor, time()+3600);
if ($background) setcookie ("background", $background, time()+3600);
if (!isset($layercolor)) $layercolor='green';
if (!isset($fontcolor)) $fontcolor='red';
if (!isset($background)) $background='one';
echo "
layercolor:
<a href='$PHP_SELF?layercolor=blue'>blue </a><br>
<a href='$PHP_SELF?layercolor=white'>white </a><br>
<a href='$PHP_SELF?layercolor=brown'>brown </a><br>
<a href='$PHP_SELF?layercolor=green'>green </a><br>
<br>
fontcolor:
<a href='$PHP_SELF?fontcolor=cyan'>cyan </a><br>
<a href='$PHP_SELF?fontcolor=magenta'>magenta </a><br>
<a href='$PHP_SELF?fontcolor=smellow'>smellow </a><br>
<a href='$PHP_SELF?fontcolor=yellow'>yellow </a><br>
<br>
background:
<a href='$PHP_SELF?background=two'>two </a><br>
<a href='$PHP_SELF?background=three'>three </a><br>
<a href='$PHP_SELF?background=four'>four </a><br>
$layercolor<br>$fontcolor<br>$background<br>
<a href='index2.php'>here</a>";