Advertisement
Guest User

CODIGO calc2.htm

a guest
Sep 21st, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <html> <head> <title>Calc2.php - Programa Completo de Calculadora</title> </head> <body> <? $y = $_POST['a']; $z = $_POST['b']; if ( isset ($_POST['btsuma']) ) { $c = $y + $z; echo " $y + $z es ".$c; } if ( isset ($_POST['btresta']) ) { $c = $y - $z; echo " $y - $z es ".$c; } if ( isset ($_POST['btmult']) ) { $c = $y * $z; echo " $y * $z es ".$c; } if (isset ($_POST['btdiv']) ) { if ( $z != 0 ) $c = $y / $z; else $c = 0; echo " $y / $z es ".$c } ?> <form name="calc" action="calc2.php" method="POST"> A : <input type="text" name="a" size="10" value="<? echo $y; ?>"> B : <input type="text" name="b" size="10" value="<? echo $z; ?>"> <br> <input type="submit" value="Suma" name = "btsuma"> <input type="submit" value="Resta" name = "btresta"> <input type="submit" value="Mult" name = "btmult"> <input type="submit" value="Division" name = "btdiv"> </form> </body> </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement