Skip to main content
Known Participant
November 24, 2009
Question

if elseif else echo statement with radio buttons

  • November 24, 2009
  • 1 reply
  • 341 views

Hi everyone  Please help me out here.  I have a standard php file with 4 groups of questions (radio groups). The user must answer "yes" to ALL 4 questions where after "You Qualify" will echo on the same page.  If any of the questions are answered "No" to, then "you do not qualify" must echo on the same page. If no answer is selected - then no echo  This sounds like a simple if elseif else  statement, but for some reason I just cant get it right.  Could anyone please help me out with this?  Herewith code that I have tried:

Do you like apples?

    

Do you like oranges?

    

Do you like pears?

    

Do you like lemons?

    

This topic has been closed for replies.

1 reply

jon8
Inspiring
November 24, 2009

<?php
if ($a > $b) {
    echo
"a is bigger than b";
} elseif (
$a == $b) {
    echo
"a is equal to b";
} else {
    echo
"a is smaller than b";
}
?>