zyra Posted May 24, 2012 Share Posted May 24, 2012 I am trying to make a multiple choice quiz,but for some reson it wont work. <div align="center"> <p> General Hood fought for which side in the Civil War? <form method="post" action="qtwo.php"> <p> <input type="radio" name="qone" value="1">Union<br> <input type="radio" name="qone" value="2">Rebel<br> <input type="radio" name="qone" value="3">Patriot<br> <br> <button type="submit"><img src="submit.png"></button> </form> </p> </div> and $_POST['qone'] = $qone; include ('head.php'); if ($qone == 2) {echo "<p> Your answer was correct!</p>";} else {echo "<p> Sorry, General Hood fought for the rebels or Confederates.</p>";} Quote Link to comment Share on other sites More sharing options...
Byron Posted May 24, 2012 Share Posted May 24, 2012 You've got this backwards: $_POST['qone'] = $qone; should be: $qone = $_POST['qone']; 1 Quote Link to comment Share on other sites More sharing options...
zyra Posted May 25, 2012 Author Share Posted May 25, 2012 Thanks! I can't believe I spent hours trying to make it work when all I needed to do was switch around a couple of variables. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.