This commit is contained in:
2023-04-20 11:27:24 +02:00
parent 4ecb2b62ca
commit 4964d61762
23 changed files with 373 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
$nbr1=$_POST['op1'];
$nbr2=$_POST['op2'];
$ope=$_POST['operation'];
if ($ope=="+"){
$resultat=$nbr1+$nbr2;
echo "<h3> Le resultat est $resultat </h3>";
}
if ($ope=="-"){
$resultat=$nbr1-$nbr2;
echo "<h3> Le resultat est $resultat </h3>";
}
if ($ope=="x"){
$resultat=$nbr1*$nbr2;
echo "<h3> Le resultat est $resultat </h3>";
}
if ($ope=="/"){
if($nbr2==0){
die("<h2> Division par 0 </h2>");
}
$resultat=$nbr1/$nbr2;
echo "<h3> Le resultat est $resultat </h3>";
}
?>