Hi
I'm using PHP to check if a form was filled out correctly, or at all. I have questions and three answers in the form of radio buttons.
I'm using "if empty" to check if a question wasn't answered but it's not doing the trick:
How should I be doing this?
Many thanks
I'm using PHP to check if a form was filled out correctly, or at all. I have questions and three answers in the form of radio buttons.
I'm using "if empty" to check if a question wasn't answered but it's not doing the trick:
PHP:
for ($i = 1; $i <= $numQuestions2; $i++) {
if (empty($_POST['radio'.$i])) {
$problem = TRUE;
$dataSpan2[$i] = '<span style="color:red; font-weight:bold;">'.$questions2[$i].'</span>';
}
else {
$dataSpan2[$i] = $questions2[$i];
}
}
Many thanks