I'm new to PHP form handling and I've handled it pretty well- apart from dealing PHP with Checkboxes.
The problem I have is I can't seem to echo out the correct 3 answers from my question. I would complete the form on my quiz ticking the correct three check boxes and for some reason PHP output's saying I have entered the wrong answer! Hope you can help, any answers will be much appreciated! :)
Here is my form and my question:
<p> 22. What professional golfers have won the masters?</p>
<input type="checkbox" name="golfer" value="a">Tiger Woods<br />
<input type="checkbox" name="golfer" value="b">Phil Mickelson<br />
<input type="checkbox" name="golfer" value="c">Lee Westwood<br />
<input type="checkbox" name="golfer" value="d">Bubba watson<br />
And here is my PHP, I'm sure it is completely wrong but hopefully you know what I'm trying to achieve:
if ($golfer == "a" && "b" && "d") {
echo "That's the right answer, Tiger Woods, Phil Mickelson and Bubba Watson have all won the Masters.";
} else {
echo "That's the wrong answer. Lee Westwood has not won a major.";
}
?>