I think I understand what is going on here, but cannot get it to work - any ideas anyone.......?
The form part works OK
but on the process page, I keep getting parse errors on the line
ELSEIF ($value <='70' && >= '51')
code for form
<form name="self-esteem" method="post" action="process_self-esteem.php">
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="#FFEFE8" valign="top">
<td width="13%"><br>
First Name:</td> <td colspan="2"> <b>
<input type="text" name="firstname" size="40"></b></td></tr>
<tr bgcolor="#FFEFE8">
<td width="13%" bgcolor="#FEAB6D">Question 1</td>
<td colspan="2" bgcolor="#FEAB6D"><b>I feel confident to deal with the normal challenges of my work and life.</b></td></tr>
<tr bgcolor="#FFEFE8">
<td width="13%" rowspan="5"> </td>
<td width="13%" height="2">
<p align="right"><b>Nearly Always</b></p></td>
<td width="74%" height="2">
<input type="radio" name="q[1-1]" value="9">
</td>
</tr>
<tr bgcolor="#FFEFE8">
<td width="13%" height="2">
<div align="right"><b>Often</b></div>
</td>
<td width="74%" height="2">
<input type="radio" name="q[1-2]" value="7">
</td>
</tr>
<tr bgcolor="#FFEFE8">
<td width="13%" height="2">
<div align="right"><b>Occasionally</b></div>
</td>
<td width="74%" height="2">
<input type="radio" name="q[1-3]" value="5">
</td>
</tr>
<tr bgcolor="#FFEFE8">
<td width="13%" height="2">
<div align="right"><b>Rarely</b></div>
</td>
<td width="74%" height="2">
<input type="radio" name="q[1-4]" value="3">
</td>
</tr>
<tr>
<td width="13%" bgcolor="#FFEFE8">
<div align="right"><b>Hardly Ever</b></div>
</td>
<td width="74%" bgcolor="#FFEFE8">
<input type="radio" name="q[1-5]" value="0">
</td>
</tr>
// etc.etc. for 10 questions
<tr bgcolor="#FFEFE8">
<td width="13%" bgcolor="#FEAB6D"> </td>
<td colspan="2" bgcolor="#FEAB6D"> <b>
<input type="submit" name="Submit" value="Evaluate Me">
<input type="reset" name="Submit2" value="Clear Form">
</b></td>
</tr>
</table>
</form>
code for processing and evaluating user input
//set variables
$Name = $_POST['firstname'];
if (!isset($_POST['submit']))
{
$answers = array(
1-1 => '0', 1-2 => '3', 1-3 => '5', 1-4 => '7', 1-5 => '9',
2-1 => '9', 2-2 => '7', 2-3 => '5', 2-4 => '3', 2-5 => '0',
3-1 => '9', 3-2 => '7', 3-3 => '5', 3-4 => '3', 3-5 => '0',
4-1 => '0', 4-2 => '3', 4-3 => '5', 4-4 => '7', 4-5 => '9',
5-1 => '0', 5-2 => '3', 5-3 => '5', 5-4 => '7', 5-5 => '9',
6-1 => '9', 6-2 => '7', 6-3 => '5', 6-4 => '3', 6-5 => '0',
7-1 => '0', 7-2 => '3', 7-3 => '5', 7-4 => '7', 7-5 => '9',
8-1 => '9', 8-2 => '7', 8-3 => '5', 8-4 => '3', 8-5 => '0',
9-1 => '9', 9-2 => '7', 9-3 => '5', 9-4 => '3', 9-5 => '0',
10-1 => '0', 10-2 => '3', 10-3 => '5', 10-4 => '7', 10-5 => '9'
);
echo "<br><br>Thank You $Name, <br>Here is the feedback on your evaluation:<br><br>";
foreach ($answers as $key => $value)
{
array_sum($value) ;
}
IF ($value >= '71')
{$body = "Evaluation:<br>
Your self esteem seems to be quite high. etc.etc. blah. blah.";}
ELSEIF ($value <='70' && >= '51')
{$body = "Evaluation:<br>
You may have moderately high self esteem. etc.etc. blah. blah.";}
ELSEIF ($value <='50' && >= '31')
{$body = "Evaluation:<br>
Your result is suggestive of low to moderate self esteem. etc.etc. blah. blah";}
ELSE ($value <= '30')
{$body = "Evaluation:
Your level of self esteem could be quite low if your result is accurate. etc.etc. blah. blah.";}
echo $body;
}