Ok, I managed to get cookies to work finally... but now they don't work properly (or too well depending on your point of view). Here's what I'm trying to do: I've got 8 check boxes, and I need to store whether or not each of those check boxes is checked or not, and then be able to read back from the cookies.
On the page that will write the cookies, I simply told it to print each of the check box's values to the browser, and it did so without any problem. When the check box is not checked, I'll get nothing, and when it is checked, I'll get a "1" (true). So I know the problem isn't with the value passing between pages.
When I setcookie() the values, if the box is checked it'll write the "1" to the cookie, but then if I go and uncheck the box, the "1" will still be there and will not go away. I tried deleting the cookies before the new values were to be written, but 1) I need to be able to keep the existing settings, and 2) well, they just won't go away.
If a checkbox is not checked, I would like to keep the cookie for it around but with a different value. If the user does not check one of the boxes, it'll write a "-" into the cookie:
if (!strcmp($cb,"1") == 0)
{
/ If $cb is anything but "1", set it to
a "-" /
$cb = "-";
}
setcookie("box",$cb,$expTime);
Anyone have any ideas on how I can go about this?
Mike