The problem appears to be with the following code...
CODE
if (isset($_REQUEST["FRMindie"]) or isset($_REQUEST["FRMCorp"])) {
if($_REQUEST["FRMindie"] != "on") { $indie = "off"; } else { $indie = "on"; }
if($_REQUEST["FRMcorp"] != "on") { $corp = "off"; } else { $corp = "on"; }
/* pass the selection to the session variables */
$_SESSION["SESindie"] = $indie;
$_SESSION["SEScorp"] = $corp;
}
else
{
$indie = $_SESSION["SESindie"];
$corp = $_SESSION["SEScorp"];
}
First off I think you meant to make the second check in your or statement to be FRMCorp and not FRMindie again. You were testing the same item twice.
Second, I didn't have problems with Corp, I had problems with indie checkbox. You were right about it being a logic problem. When you select the indie checkbox it makes $indie on and stores it in the session... great. Good so far. The problem is when you turn it off with the checkbox. When you check it off, the first if statement above checks to see if FRMindie is set. It isn't (because you checked it off) and so it loads up the "on" from the session and checks the box again. You go to check it off again and the cycle goes right back through, it is off again, so it loads from session and turns it on again. So the indie checkbox never turns off.
You could fix this by simply testing for the existence of FRMindie to begin with and in turn set $indie on or off based on that alone. Make a separate test for FRMCorp.
CODE
if (isset($_REQUEST["FRMindie"])) {
$_SESSION["SESindie"] = "on";
}
else { $_SESSION["SESindie"] = "off"; }
if (isset($_REQUEST["FRMcorp"])) {
$_SESSION["SEScorp"] = "on";
}
else { $_SESSION["SEScorp"] = "off"; }
$indie = $_SESSION["SESindie"];
$corp = $_SESSION["SEScorp"];
Here we detect whether or not the checkbox was even set and if it was, set the session var to on. Otherwise turn it off in the session. Same with corp. At the end we take whatever the status is in the session and populate the $indie and $corp variables.
Lastly, you might want to use "||" instead of "or" in the future for any joining of conditions.
This should fix your problems. Enjoy!

"At DIC we be session manipulating code ninjas!"