1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <html>
<head>
<br> <h1> calculatrice </h1> </br>
</head>
<body bgcolor="white">
<p>
<form action="exercice5.php" method="post">
<table>
<input type="text" name="affichage" value="<?php echo $_POST["affichage"].$_POST["submit"]?>" style="width:133px;"/> <br/>
<input type="submit" name="submit" value="7" style="width:30px;"/>
<input type="submit" name="submit" value="8"style="width:30px;"/>
<input type="submit" name="submit" value="9" style="width:30px;"/>
<input type="submit" name="addition" value="+" style="width:30px;"/><br/>
<input type="submit" name="submit" value="4" style="width:30px;"/>
<input type="submit" name="submit" value="5" style="width:30px;"/>
<input type="submit" name="submit" value="6" style="width:30px;"/>
<input type="reset" name="reset" value="CE" style="width:30px;"/><br/>
<input type="submit" name="submit" value="1" style="width:30px;"/>
<input type="submit" name="submit" value="2" style="width:30px;"/>
<input type="submit" name="submit" value="3" style="width:30px;"/>
<input type="submit" name="resultat" value="=" style="width:30px;"/><br/>
<input type="submit" name="submit" value="0" style="width:30px;"/>
<input type="submit" name="submit" value="!" style="width:30px;"/>
<input type="submit" name="submit" value="!" style="width:30px;"/>
<input type="submit" name="submit" value="!" style="width:30px;"/>
</table>
</form>
<?php
//if ($_POST["affichage"].$_POST["submit"]!="" )
//$_POST["reset"];
$a=$_POST["affichage"].$_POST["submit"];
$b=$_POST["affichage"].$_POST["submit"];
$op=$_POST["afficher"];
eval( "\$r = \" $op\";" );
$_POST["addition"]=+;
echo $a.$_POST["addition"].$b;
?>
<p>
</body>
</html> |
Partager