I am trying to get data from form and display result to Student but I am gettign error PRASE Error “T_IS_SMALLER_OR_EQUAL”, I am new user of PHP plz help me out to rectify the problem looking forward to hear u soon.
my both files are given below:
My first file is report.php
<html>
<head>
</head>
<body>
<form method="get" action="s_report.php">
<p> </p>
<table width="75%" border="1">
<tr>
<td colspan="2">Result card</td>
</tr>
<tr>
<td width="29%"> </td>
<td width="71%"> </td>
</tr>
<tr>
<td>Name</td>
<td><input name="name" type="text" id="name2"></td>
</tr>
<tr>
<td>Math</td>
<td><input name="math" type="text" id="math2" size="5"></td>
</tr>
<tr>
<td>English</td>
<td><input name="eng" type="text" id="eng2" size="5"></td>
</tr>
<tr>
<td>Urdu</td>
<td><input name="urdu" type="text" id="urdu2" size="5"></td>
</tr>
<tr>
<td>Islamiat</td>
<td><input name="islam" type="text" id="islam2" size="5"></td>
</tr>
<tr>
<td>Economics</td>
<td><input name="econ" type="text" id="econ2" size="5"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><input name="Submit" type="submit" id="Submit" value="Show My Result"></td>
<td> </td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
My second file is s_report.php
<html>
<head></head>
<body>
<b>Your Report Card</b><br>
<?php
echo "Mr<b> " . $_GET["name"] . ", </b>You got followings marks:<br>";
$totalnumber= $_GET["math"] + $_GET["eng"] + $_GET["urdu"] + $_GET["islam"] + $_GET["econ"];
$totalmarks = (($totalnumber*100)/500);
if ($totalmarks >= 50 && <= 60)
{
echo "You got $totalmarks marks, and Your Grade is "C"";
}
elseif ($totalmarks >= 60 && <= 70)
{
echo "You got $totalmarks marks, and Your Grade is "B"";
}
elseif ($totalmarks >= 70 && <= 80)
{
echo "You got $totalmarks marks, and Your Grade is "A"";
}
elseif ($totalmarks >= 80 && <= 90)
{
echo "You got $totalmarks marks, and Your Grade is "A1"";
}
elseif ($totalmarks >= 90 && <= 100)
{
echo "You got $totalmarks marks, and Your are on the TOP Position";
}
else
{
echo "You are failed";
}
?>
</body>
</html>
MOD EDIT: Added code tags