PoYRaZ
Aktif
PHP:
<form id="form1" name="form1" method="post" action="">
<p>Please enter the number
</p>
<p>
<input type="text" name="number1"/>
</p>
<p>
<input type="text" name="number2"/>
</p><strong>Calculate</strong>
<p>
<input type="radio" name="radio" id="radio" value="Plus" />
Plus
<input type="radio" name="radio" id="radio2" value="Mines" />
Mines
<input type="radio" name="radio" id="radio3" value="Mult." />
Mult.
<input type="radio" name="radio" id="radio4" value="Divide" />
Divide</p>
<p>
<input type="submit" name="action" value="Submit" />
</p>
<p> </p>
</form>
<?php
if (isset($_POST['action']) and $_POST['action'] == 'Submit')
{
$number1=$_POST["number1"];
$number2=$_POST["number2"];
$radio=$_POST["radio"];
if ($radio=='Mines'){
$cevap = $number1 - $number2;
echo $cevap;
}
if ($radio=='Plus'){
$cevap = $number1 + $number2;
echo $cevap;
}
if ($radio=='Mult.'){
$cevap = $number1 * $number2;
echo $cevap;
}
if ($radio=='Divide'){
$cevap = $number1 / $number2;
echo $cevap;
}
}
?>