I need a PHP code from a calculator, which adds 4 notes and divides by 4 and if the final media is greater than or equal to 6 that it shows approved, otherwise fail. SCRR
<?php
$nt1 = $_GET[$nt1];
$nt2 = $_GET[$nt2];
$nt3 = $_GET[$nt3];
$nt4 = $_GET[$nt4];
$mf = ( $nt1 + $nt2 + $nt3 + $nt4)/4;
echo " $nt1, $nt2, $nt3, $nt4, $mf ";
if ( $mf >= 6 ) {
echo "aprovado" ;
}
else{
echo "Reprovado";
}
?>
HTML code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> calculadora </title>
</head>
<body>
<form action="calculadora.php" method = "get">
<table border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
<tbody>
<tr>
<td>Primeiro bimestre</td>
<td><input name="$nt1" type="text" /></td>
</tr>
<tr>
<td>Segundo bimestre</td>
<td><input name="$nt2" type="text" /></td>
</tr>
<tr>
<td>terceiro bimestre</td>
<td><input name="$nt3" type="text" /></td>
</tr><tr>
<td>quarto bimestre</td>
<td><input name="$nt4" type="text" /></td>
</tr>
<tr>
<td></td>
<td><input name="bt_validar" type="submit" value="Calcular" /></td>
</tr>
</tbody>
</table>
</body>
</html>