I have the following code below that retrieves one of four optional checkbox answers to one quesition.
In my database instead of reading the correpsonding value, it always posts 0
for each time a box is ticked. I'm guessing this is the key. How is it possible to show the value here? I tried replacing key with value, but with no success.
-Here are my codes-
PHP:
foreach($_POST['Person'] as $key=>$Person) {
$_POST['Person'][$key] = intval($Person);
}
$Person = implode(',', $_POST['Person']);
HTML:
<ul class="ratings">
<li><input type="checkbox" name="Person[1]" value="Excellent" /></li>
<li><input type="checkbox" name="Person[2]" value="Good" /></li>
<li><input type="checkbox" name="Person[3]" value="Satisfactory" /></li>
<li><input type="checkbox" name="Person[4]" value="Poor" /></li>
</ul>