Mailzero
2-MASALA:
  1. if(isset($_POST['yech'])){
  2. $a = $_POST['son1'];
  3. $b = $_POST['son2'];
  4. $type = $_POST['type'];
  5. if ($type == 'plus') {
  6. $c = $a + $b;
  7. }elseif ($type == 'minus') {
  8. $c = $a - $b;
  9. } elseif ($type == 'multi') {
  10. $c = $a * $b;
  11. }elseif ($type == 'drop'){
  12. $c = $a / $b;
  13. }
  14. echo'<h2>Natija: '.$c.'</h2>';
  15. }
  16.  
  17.  
  18. echo'<form name="form" action="" method="POST">
  19. Birinchi sonni kiriting:<br>
  20. <input type="number" name="son1" required><br>
  21. Amal turi:<br>
  22. <select name="type">
  23. <option value="plus"> Qo\'shish</option>
  24. <option value="minus"> Ayirish</option>
  25. <option value="multi"> Ko\'paytirish</option>
  26. <option value="drop"> Bo\'lish</option>
  27. </select><br>
  28. Ikkinchi sonni kiriting:<br>
  29. <input type="number" name="son2" required><br>
  30. <input name="yech" type="submit" value="Yechimni ko\'rish">
  31. </form>';