!isset & request method = post, set cookie to 0?
Posted: Thu May 24, 2007 1:14 pm
Using...
The first part of the PHP seems to work. However to unset the option the user unchecks the input and the page is requested via a POST (because of the form) I'd like to set the cookie to a value of 0.
What do I need to change?
Code: Select all
<form><fieldset><input name="chatroom" type="checkbox" value=1" />Code: Select all
if ($_POST['chatroom']=='1') {setcookie('chatroom','1',time()+2592000,'/');}
else if (isset($_REQUEST['post']) && !isset($_POST['chatroom'])) {setcookie('chatroom','0',time()+2592000,'/');}