Danny B
2009-02-08 10:49:31 UTC
Parse error: parse error in F:\xampplite-win32-1.7.0\xampplite\htdocs\d\7-1b.php on line 26
Note: I can comment out all the elseifs and the code will work, it will give me the expected results for A and it will give me the expected error message if one of my values is not numeric. I am confused as to why I receive parse errors upon moving into my elseifs. Also even were I to change the elseifs to just regular ifs I still receive the same error.
extract($_REQUEST, EXTR_SKIP);
if (is_numeric($g1) and is_numeric($g2) and is_numeric($g3))
{
$gAve = (round(($g1 + $g2 + $g3)/3));
if ($gAve >= 90)
{
print("
$gAve A
");}
elseif ($gAve >=80 and <=89)
{
print("
$gAve B
");}
elseif ($gAve >=70 and <=79)
{
print("
$gAve C
");}
elseif ($gAve >=60 and <=69)
{
print("
$gAve D
");}
elseif ($gAve <=59 and >=0)
{
print("
$gAve F
You must not fail!!! DO BETTER!!!!!!
");
}
else
{
print("negative numbers are not acceptable entries");
}
}
else
{
print ("please enter numeric data only");
}
?>