all the code is
$Name = $_POST['firstname'];
if (!isset($_POST['submit']))
{
$answers = array(
1 => 'false',
2 => 'false',
3 => 'false',
4 => 'false',
5 => 'false',
6 => 'false',
7 => 'false',
8 => 'false',
9 => 'false',
10 => 'false',
11 => 'false',
12 => 'false'
);
echo "<br><br>Thank You $Name, <br>Here is the feedback on your assessment:<br><br>";
$i = 0;
foreach ($answers as $key => $value)
{
if ($value == $_POST['q'][$key]) {$i++;}
}
echo '<br>';
echo '<br>You got ' . $i . ' out of ' . count($answers) . ' correct. <br><br>';
}
IF ($value != $_POST['q'][1])
{$body .= " <br><br>
Question 1 The right answer was False. <br>A good leader etc.etc. ";}
ELSE
{$body .= " <br><br>
Question 1 - You got this correct. A good leader etc.etc.<br><br> ";}
IF ($value != $_POST['q'][2])
{$body .= " <br><br>
Question 2 The right answer was False. <br>The person in charge of a unit etc.etc.<br><br> ";}
ELSE
{$body .= " <br><br>
Question 2 - You got this correct. The person in charge of a unit etc.etc.<br><br> ";}
IF ($value != $_POST['q'][3])
{$body .= " <br><br>
Question 3 etc. .<br><br> ";}
ELSE
{$body .= " <br><br>
Question 3 - Yo
etc..<br><br> ";}
// and so on for 12 questions
echo $body;
echo '<form name="leadership" method="post" action="leadership_email.php">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="#FFEFE8" valign="top">
<td width="13%"><br>
E-Mail:</td>
<td colspan="2">
<p><b>
<input type="text" name="email" size="40">
<br>
If you would like one of our team to assess this information
in more detail,<br>
and e-mail you with some recomendations, then please fill in
your e-mail address here.<br>
</b>All your information is treated in the strictest of confidence,
your e-mail address is held only by <br>
us, and will not be passed on to any
other party.
<input type="hidden" name="name" value="<?php echo $Name; ?>" >
<input type="hidden" name="body" value="{$body}">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</td>
</tr> </table></form>';