Facebook
From WarForPeace, 3 Years ago, written in PHP.
Embed
Download Paste or View Raw
Hits: 70
  1. <?php
  2. if ($_POST) {
  3.     $not1 = $_POST['not1'];
  4.     $not2 = $_POST['not2'];
  5.     $sozlu1 = $_POST['sozlu1'];
  6.     $total = $not1 + $not2 + $sozlu1;
  7.     $ort = $total / 3;
  8.  
  9.     if ($ort >= 50) {
  10.         $durum = '<td style="color:#8dbf42;">Geçti</td>';
  11.     } else {
  12.         $durum = '<td style="color:#e7515a;">Kaldı</td>';
  13.     }
  14. }
  15. ?>
  16.  
  17. <html>
  18.  
  19. <body>
  20.  
  21.     <form method="POST">
  22.         <input id="not1" name="not1" placeholder="1. notu giriniz">
  23.         <input id="not2" name="not2" placeholder="2. notu giriniz">
  24.         <input id="sozlu1" name="sozlu1" placeholder="1. sözlüyü giriniz">
  25.         <button class="btn btn-primary float-right" type="submit">Hesapla!</button>
  26.  
  27.         <table border="2">
  28.             <th>Ortalama
  29.             <th>Durum
  30.                 <tr>                    
  31.                     <?php echo '<td>' . $ort . '</td>'; ?>
  32.                     <?php echo $durum; ?>
  33.                 </tr>
  34.         </table>
  35.  
  36. </body>
  37.  
  38. </html>