fork download
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <form action="else_if.php" method="POST">
  5. Prelim: <input type="text" name="pre"><br><br>
  6. Midterm:<input type="text" name="mid"><br><br>
  7. Final: <input type="text" name="fin"><br><br>
  8. <input type ="submit" name="submit" value="Submit">
  9.  
  10. <?php
  11. if (isset($_POST['submit'])){
  12. $pre = $_POST['pre'];
  13. $mid = $_POST['mid'];
  14. $fin = $_POST['fin'];
  15. $ave = $_POST(($_POST['pre'] + $_POST['mid']+ $_POST['fin'])/3);
  16.  
  17. if($ave >= 75){
  18. echo"</br> Passed";
  19. }
  20. else {
  21. echo"</br>Failed";
  22. }
  23. }
  24. ?>
  25. </form>
  26. </body>
  27. </html>
Success #stdin #stdout 0.03s 25800KB
stdin
Standard input is empty
stdout
<!DOCTYPE html>
<html>
<body>
<form action="else_if.php" method="POST">
Prelim: <input type="text" name="pre"><br><br>
Midterm:<input type="text" name="mid"><br><br>
Final: <input type="text" name="fin"><br><br>
<input type ="submit" name="submit" value="Submit">

</form>
</body>
</html>