baru - PHP Online
Form of PHP Sandbox
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of baru.php
- <!DOCTYPE html>
- <html>
- <head>
- <title>Syarif Hidayat</title>
- <link rel="stylesheet" type="text/css" href="css/sk4.css">
- </head>
- <body>
- <form method="POST" action="akhir.php">
- <table align="center">
- <tr>
- <td>Nilai Tugas</td>
- <td><input type="text" name="tugas"></td>
- </tr>
- <tr>
- <td>Nilai Ulangan Harian</td>
- <td><input type="text" name="harian"></td>
- </tr>
- <tr>
- <td>Nilai UTS</td>
- <td><input type="text" name="ulangan"></td>
- </tr>
- <tr>
- <td>Nilai UAS</td>
- <td><input type="text" name="akhiran"></td>
- </tr>
- <tr>
- <td></td>
- <td><input class="button" type="submit" name="submit"></td>
- </tr>
- </table>
- </form>
- <?php
- $tugas =(float) $_POST['tugas']*20/100;
- $harian = (float)$_POST['harian']*10/100;
- $uts = (float)$_POST['ulangan']*30/100;
- $uass = $_POST['akhiran']*40/100;
- $jumlah = $tugas + $harian + $uts + $uass;
- // echo $jumlah;
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Akhir</title>
- </head>
- <body>
- <?php
- if ($jumlah > 80) {
- echo "<p style='color : green'>
- A : $jumlah</p>
- ";
- }else if($jumlah >= 70 || $jumlah <= 79){
- echo "<p style='color : blue'>
- B : $jumlah</p>
- ";
- }else if ($jumlah >= 60 || $jumlah <= 69) {
- echo "<p style='color : yellow'>
- C : $jumlah";
- }else if ($jumlah >= 50 || $jumlah <= 59) {
- echo "<p style='color : orange'>
- D : $jumlah</p>
- ";
- }else if ($jumlah < 50) {
- echo "<p style='color : red'>E : $jumlah</p>
- ";
- }else{
- echo "suram";
- }
- ?>
- </body>
- </html>
- </body>
- </html>
File Description
- baru
- PHP Code
- 22 Oct-2019
- 1.78 Kb
You can Share it:
Latest PHP Pastes