I am trying to allow users to fill out a form (all radio buttons), have them hit "submit/calculate", have PHP add the radio button variables (integers), and output the total, but the script keeps showing me the last calaculation done at the top and I don't want it to show. How do I clear the results after one user doesn't see the last user's results or her own previous results?
<?php
$totalScore=0;
{
$_POST['Over35']+$_POST['Under15']=$totalScore;
echo $totalScore;
}
?>
<form action="HighRiskPregnancyEvaluation.php" method="POST">
<table width="418" border="0" cellpadding="4" bgcolor="#FFFFFF" align="center">
<tr>
<th colspan="3">
<h3><font face="Arial, Helvetica, sans-serif">Scoring a High-Risk Pregnancy</font></h3>
</th>
</tr>
<tr>
<td valign="TOP" colspan="3">
<p align="LEFT">A high-risk pregnancy is a pregnancy in which the risk
of illness or death before or after delivery is greater than usual for
the mother or baby.</p>
<p></p>
<p align="LEFT">Answer the following questions to determine if your pregnancy
is considered high-risk.</p>
</td>
</tr>
<tr>
<td valign="TOP" colspan="3" bgcolor="#CCCCCC"><strong>Before Pregnancy</strong></td>
</tr>
<tr>
<td valign="TOP" colspan="3"><strong><em>Characteristics of the mother</em></strong></td>
</tr>
<tr>
<td valign="TOP"><strong>Risk Factors</strong></td>
<td valign="TOP"><strong>Yes</strong></td>
<td valign="TOP"><b>No</b></td>
</tr>
<tr>
<td valign="TOP">Are you age 35 or over?</td>
<td valign="TOP">
<input type="radio" name="Over35" value="5">
5</td>
<td valign="TOP">
<input type="radio" name="Over35" value="0" checked>
</td>
</tr>
<tr>
<td valign="TOP">Are you age 15 or under?</td>
<td valign="TOP">
<input type="radio" name="Under15" value="5">
5</td>
<td valign="TOP">
<input type="radio" name="radiobutton" value="0" checked>
</td>
</tr>
<tr>
<td valign="TOP">Do you weigh less than 100 pounds?</td>
<td valign="TOP">5
<input type="radio" name="LessThan100lbs" value="5">
</td>
<td valign="TOP">
<input type="radio" name="LessThan100lbs" value="0" checked>
</td>
</tr>
<tr>
<td valign="TOP">Do you weigh or more than 200 lbs.?</td>
<td valign="TOP">5
<input type="radio" name="MoreThan200lbs" value="5">
</td>
<td valign="TOP">
<input type="radio" name="MoreThan200lbs" value="0" checked>
</td>
</tr>
<tr>
<td valign="TOP" colspan="3"><strong><em>Events in a previous pregnancy</em></strong></td>
</tr>
<tr>
<td valign="TOP"><strong>Risk Factors</strong></td>
<td valign="TOP"><strong>Yes</strong></td>
<td valign="TOP"><b>No</b></td>
</tr>
<tr>
<td valign="TOP">Have you ever had a stillbirth?</td>
<td valign="TOP">10
<input type="radio" name="Stillbirth" value="10">
</td>
<td valign="TOP">
<input type="radio" name="Stillbirth" value="0" checked>
</td>
</tr>
<tr>
<td valign="TOP">Have you experienced a newborn death?</td>
<td valign="TOP">10
<input type="radio" name="NewbornDeath" value="10">
</td>
<td valign="TOP">
<input type="radio" name="NewbornDeath" value="0" checked>
</td>
</tr>
<tr>
<td valign="TOP">
<div align="right">+</div>
</td>
<td valign="TOP" colspan="2">__________</td>
</tr>
<tr>
<td valign="TOP"> </td>
<td valign="TOP" colspan="2">
<input type="submit" name="Submit" value="Calculate!">
</table>
</form>
<div align="center">
<p><br>
Based On: <i><a href="http://www.merck.com/pubs/mmanual_home/sec22/244.htm" target="_blank">The
Merck Manual of Medical Information--Home Edition</a></i> <a href="http://www.merck.com/pubs/mmanual_home/sec22/244.htm"><br>
<i>Section 22. Women's Health Issues. Chapter 244</i></a> </p>
<p>A score of 10 or more indicates high risk.</p>
</div>