I need to get more than one checkbox value, if I have more than one value, for example:
<input type="checkbox" name="combustivel[]" value="Marco">
<input type="checkbox" name="combustivel[]" value="Empres contratada">
<input type="checkbox" name="combustivel[]" value="Desconto">
If I need to mark the Marco and Discount checkbox, how can I get these two?
I've got this code on the web:
if(!empty($_POST['combustivel'])) {
foreach($_POST['combustivel'] as $comb) {
echo $comb;
}
}
But the following warning appears:
Warning: Invalid argument supplied for foreach () ....