Jump to content

Recommended Posts

Posted

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>";}

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...