Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/05/2010, 17:47
Avatar de bocho0610
bocho0610
 
Fecha de Ingreso: enero-2010
Ubicación: <? echo "Santiago, Chile"; ?>
Mensajes: 341
Antigüedad: 14 años, 4 meses
Puntos: 26
Respuesta: Programa simple - error envio de formulario

Cargar_datos.html
Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <title>Ejercicio 08 - Cargar datos</title>
  4. </head>
  5. <body>
  6. <form method="POST" action="Procesar_datos.php">
  7. <p>Ingrese su nombre:
  8. <input type="text" name="txt_Nombre">
  9. </p>
  10. <p>Ingrese su edad:
  11. <input type="text" name="txt_Edad">
  12. </p>
  13. <input type="submit" name="btn_Enviar" value="Enviar">
  14. </form>
  15. </body>
  16. </html>

Procesar_datos.php
Código PHP:
Ver original
  1. <html>
  2. <head>
  3. <title>Ejercicio 08 - Procesar datos</title>
  4. </head>
  5. <body>
  6. <?
  7. $nombre=$_POST['txt_Nombre'];
  8. $edad=$_POST['txt_Edad'];
  9. echo ("El nombre ingresado es: ".$nombre);
  10. echo ("<br>");
  11. if ( $edad > 18)
  12. echo ($nombre." es mayor de edad, ya que tiene ".$edad);
  13. else
  14. echo ($nombre." es menor de edad, ya que tiene ".$edad);
  15. ?>
  16. </body>
  17. </html>