Problems: PHP turning a student mark to a grade using if elseif || Grade Calculator Using PHP and HTM
Source Code:
<!DOCTYPE html><html>
<head>
<title></title>
</head>
<body>
<form method="post" action="index.php">
<label>Marks:</label>
<input type="number" name="number" placeholder="inter u sub. marks"><br>
<input type="submit" name="submit"><br>
</form>
<?php
$num= $_POST['number'];
if ($num>=80) {
echo "GPA: A+";
}
elseif ($num>=70) {
echo "GPA: A";
}
elseif ($num>=60) {
echo "GPA: A-";
}
elseif ($num>=50) {
echo "GPA: B";
}
elseif ($num>=40) {
echo "GPA: C";
}
elseif ($num>=40) {
echo "GPA: D";
}
elseif ($num<40) {
echo "Failed";
}
?>
</body>
</html>
Screenshots of Source Code(Sublime Text):
💬আরো পড়ুন এবং জানুন💬
- Create a password field in HTML form
- Basic Forms | HTML Input
- PHP Calculating GPA
- Write the php code to calculate the display GPA in the web browser
- How to Insert Data Into MySQL Database Table & Retrieving data form database Using PHP
- How to Insert and retrieving data from MySQL database using Program
- Creating a new database & Table in mysql Databases
Post a Comment