SHARE
TWEET

CODIGO calc2.htm

a guest Sep 21st, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top