I have nine checkboxes on this form. Each is named ocover[] and they range in value from 0 to 8. Upon submitting the form, I want to register those values that were checked with the current session. Here's the code I'm using:
foreach($_POST["ocovers"] as $value) $_SESSION["ocover".$value] = 1;
Apparently (maybe obviously), I'm doing something wrong. Anyone know what's up?
Hi,
foreach($_POST["ocovers"] as $value)
for me this will give you the value in array, not the number.
May be you can solve with some like this while (list ($key, $value) = each ($_POST))
for more help: www.php.net/each and www.php.net/list
see you