Let's say the user selects "Checkbox #1" and "Checkbox #3" in the form below and submit, the values will be passed as "01" and "03", right? How can do for these values "01" and "03" passed by the form to recognize it's respective local vars "$checkbox_01" and "$checkbox_03" and print it's values on screen?
HTML Code:
<html><head></head><body>
<form name=f1 method=post action=get_checked.php>
<input name="checkboxes[]" type="checkbox" value="01">Checkbox #1<br>
<input name="checkboxes[]" type="checkbox" value="02">Checkbox #2<br>
<input name="checkboxes[]" type="checkbox" value="03">Checkbox #3<br>
<input name="Submit" type="submit" value="Submit">
</form>
</body></html>
<?
// get_checked.php
$checkbox_01 = "Phrase 01";
$checkbox_02 = "Phrase 02";
$checkbox_03 = "Phrase 03";
$count_checked = count($checkboxes);
for ($i=0; $i<$count_checked; $i++) {
echo $checkboxes[$i];
}
?>