This commit is contained in:
EmmanuelTiamzon
2025-09-30 09:43:41 +02:00
parent f7de13bc2a
commit 7019a3b7ea
176 changed files with 9458 additions and 149 deletions

22
DEV.2.2/TP/TP2/ex3.php Normal file
View File

@@ -0,0 +1,22 @@
<?php //première version
$op1 = $_POST['op1'];
$op2 = $_POST['op2'];
$operation = $_POST['operation'];
if($soumis){
if($operation == '/' && $op2 == 0) {
echo"<h3>On ne peut pas diviser par 0.</h3>";
exit();
} else {
if($operation == '+') {
$res = $op1+$op2;
} elseif ($operation == '-') {
$res = $op1-$op2;
} elseif ($operation == 'x') {
$res = $op1*$op2;
} elseif ($operation == '/') {
$res = $op1/$op2;
}
}
}
?>