Checking if radio button is used

Status
Not open for further replies.

bukwus

Baseband Member
Messages
53
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:
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];
			}
		}
How should I be doing this?
Many thanks
 
Status
Not open for further replies.
Back
Top Bottom