Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=83530
Postga havola
ƒυтвσĻιѕт [665] [off]
if(isset($_POST['yech'])){
$a = $_POST['son1'];
$b = $_POST['son2'];
$type = $_POST['type'];
if ($type == 'plus') {
$c = $a + $b;
}elseif ($type == 'minus') {
$c = $a - $b;
} elseif ($type == 'multi') {
$c = $a * $b;
}elseif ($type == 'drop'){
$c = $a / $b;
}
echo'<h2>Natija: '.$c.'</h2>';
}
echo'<form name="form" action="" method="POST">
Birinchi sonni kiriting:<br>
<input type="number" name="son1" required><br>
Amal turi:<br>
<select name="type">
<option value="plus"> Qo\'shish</option>
<option value="minus"> Ayirish</option>
<option value="multi"> Ko\'paytirish</option>
<option value="drop"> Bo\'lish</option>
</select><br>
Ikkinchi sonni kiriting:<br>
<input type="number" name="son2" required><br>
<input name="yech" type="submit" value="Yechimni ko\'rish">
</form>';
$a = $_POST['son1'];
$b = $_POST['son2'];
$type = $_POST['type'];
if ($type == 'plus') {
$c = $a + $b;
}elseif ($type == 'minus') {
$c = $a - $b;
} elseif ($type == 'multi') {
$c = $a * $b;
}elseif ($type == 'drop'){
$c = $a / $b;
}
echo'<h2>Natija: '.$c.'</h2>';
}
echo'<form name="form" action="" method="POST">
Birinchi sonni kiriting:<br>
<input type="number" name="son1" required><br>
Amal turi:<br>
<select name="type">
<option value="plus"> Qo\'shish</option>
<option value="minus"> Ayirish</option>
<option value="multi"> Ko\'paytirish</option>
<option value="drop"> Bo\'lish</option>
</select><br>
Ikkinchi sonni kiriting:<br>
<input type="number" name="son2" required><br>
<input name="yech" type="submit" value="Yechimni ko\'rish">
</form>';