Help with retrieving answers from radio buttons
<pre><code>$host = 'localhost';
$user = 'root';
$pw = '';
$db = 'pmdb';

mysql_connect($host,$user,$pw); 
mysql_select_db($db);

$result = mysql_query("SELECT * FROM Questions WHERE QuizID=1");
$num_rows = mysql_num_rows($result);
while($row = mysql_fetch_assoc($result))
{
    $array[] = $row;
}
for($i=0; $i&lt;=($num_rows-1); $i++)
{
  $title = $array[$i]['Title'];
  $ans1 = $array[$i]['Answer1'];
  $ans2 = $array[$i]['Answer2'];
  $ans3 = $array[$i]['Answer3'];
  $ans4 = $array[$i]['Answer4'];
  echo $title.'&lt;br&gt;';
  echo '&lt;form method="post"&gt;';
  echo '&lt;input type="radio" name="ans'.$i.'"&gt;'.$ans1.'&lt;br&gt;';
  echo '&lt;input type="radio" name="ans'.$i.'"&gt;'.$ans2.'&lt;br&gt;';
  echo '&lt;input type="radio" name="ans'.$i.'"&gt;'.$ans3.'&lt;br&gt;';
  echo '&lt;input type="radio" name="ans'.$i.'"&gt;'.$ans4.'&lt;br&gt;';
 }
echo '&lt;input type="submit" value="submit" id="submit"&gt;';
echo '&lt;/form&gt;';
</code></pre>

<p>I manage to display the question followed by the corresponding choices and at the bottom a submit button. </p>

<p>How would I, on click of the submit button, get the values that the user have chosen for each question that was looped out from the database? <code>ans1</code>, <code>ans2</code>, etc.</p>

<p>This is necessary to compare their answer to the answer key and compute their score.</p>

<p>.help please! Thank you very much and More power!</p>
