Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.38 KB | None | 0 0
  1. <style>
  2.  
  3.     h1{
  4.         text-align: center;
  5.     }
  6.  
  7.     table{
  8.         background-color:#FFC;
  9.         padding:5px;
  10.         border:#666 5px solid;
  11.  
  12.     }
  13.  
  14.  
  15. </style>
  16.  
  17. <h1>USANDO OPERADORES COMPARACION<h1>
  18.  
  19. <form action="validacion.php" method="post" name="datos_usuario" id="datos_usuario">
  20.     <table width="15%" align="center">
  21.         <tr>
  22.             <td>Nombre:</td>
  23.             <td><label for="nombre_usuario"></label>
  24.                 <input type="text" name="nombre_usuario" id="nombre_usuario"></td>
  25.         </tr>
  26.         <tr>
  27.             <td>Edad:</td>
  28.             <td><label for="edad_usuario"></label>
  29.                 <input type="text" name="edad_usuario" id="edad_usuario"></td>
  30.         </tr>
  31.         <tr>
  32.             <td>&nbsp;</td>
  33.             <td>&nbsp;</td>
  34.         </tr>
  35.         <tr>
  36.             <td colspan="2" align="center"><input type="submit" name="enviando" id="enviando" value="enviar"></td>
  37.         </tr>
  38.     </table>
  39. </form>    
  40.  
  41. <h1>CALCULADORA<h1>
  42.  
  43. <form action="" method="post" name="form1" id="calculadora">
  44.     <table width="15%" align="center">
  45.         <tr>
  46.             <td>Dato 1:</td>
  47.             <td><label for="num1"></label>
  48.                 <input type="text" name="num1" id="num1"></td>
  49.         </tr>
  50.         <tr>
  51.             <td>Dato 2:</td>
  52.             <td><label for="num2"></label>
  53.                 <input type="text" name="num2" id="num2"></td>
  54.         </tr>
  55.         <tr>
  56.             <td>Operacion:</td>
  57.             <td><label for="operacion"></label>
  58.                 <select name="operacion" id="operacion">
  59.                 <option>Suma</option>
  60.                 <option>Resta</option>
  61.                 <option>Multiplicacion</option>
  62.                 <option>Division</option>
  63.                 <option>Modulo</option>
  64.                 <option>Incremento</option>
  65.                 <option>Decremento</option>
  66.                 </select> </td>
  67.         </tr>
  68.         <tr>
  69.             <td>&nbsp;</td>
  70.             <td>&nbsp;</td>
  71.         </tr>
  72.         <tr>
  73.             <td colspan="2" align="center"><input type="submit" name="button" id="button" value="calcular"></td>
  74.         </tr>
  75.     </table>
  76. </form>    
  77.  
  78. <?php
  79.  
  80. include ("calculadora.php");
  81.  
  82. if(isset($_POST["button"])){
  83.  
  84.     $numero1=$_POST["num1"];
  85.     $numero2=$_POST["num2"];
  86.     $operacion=$_POST["operacion"];
  87.  
  88.     calcular($operacion);
  89. }  
  90.  
  91. include ("segunda_prueba.php");
  92.  
  93. print "Hola Mundo <br>";
  94. print " Luis O <br>";
  95.  
  96. include ("Clases.php");
  97.  
  98. $mazda=new Carro();
  99. $pegaso=new Camion();
  100.  
  101. $mazda->set_color("rojo","mazda");
  102.  
  103. echo "El carro tiene " . $mazda->get_ruedas() . " ruedas <br>";
  104.  
  105. echo "El camion tiene " . $pegaso->get_ruedas() . " ruedas <br>";
  106.  
  107. echo "El camion es de color " . $pegaso->color . "<br>";
  108.  
  109. echo "El camion " . $pegaso->frena();
  110.  
  111. echo "El camion " . $pegaso->girar();
  112.  
  113.  
  114. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement