Jump to content


Photo

help with error report


  • Please log in to reply
1 reply to this topic

#1 bassplaya4string

bassplaya4string
  • Members
  • PipPip
  • Member
  • 15 posts

Posted 11 October 2006 - 07:36 PM

I created a form with 10 radio buttons, if the user misses one of the buttons after clicking submit, I want an error message to come up. I got it working except the error message always comes up even if they have selected all of the radio buttons....here is my code....can someone please help!?
} else {
$i = 0;
$throw = false;

while ($i < 10)
{
$questions[$i] == null;
$throw = true;
$i++;

}

if ($throw) {
echo "It appears that you missed one of the questions. Please hit the back button and return to the quiz.<br />";
}


#2 Jocka

Jocka
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationDallas, Texas

Posted 11 October 2006 - 08:10 PM

you could just do it a different way.. like instead of:

$throw = true;

use

$throw = '1';

Then

if($throw == '1'){
  echo "Error message";
}




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users