Cargar_datos.html
Código PHP:
Ver original<html>
<head>
<title>Ejercicio 08 - Cargar datos</title>
</head>
<body>
<form method="POST" action="Procesar_datos.php">
<p>Ingrese su nombre:
<input type="text" name="txt_Nombre">
</p>
<p>Ingrese su edad:
<input type="text" name="txt_Edad">
</p>
<input type="submit" name="btn_Enviar" value="Enviar">
</form>
</body>
</html>
Procesar_datos.php
Código PHP:
Ver original<html>
<head>
<title>Ejercicio 08 - Procesar datos</title>
</head>
<body>
<?
$nombre=$_POST['txt_Nombre'];
$edad=$_POST['txt_Edad'];
echo ("El nombre ingresado es: ".$nombre);
echo ("<br>");
if ( $edad > 18)
echo ($nombre." es mayor de edad, ya que tiene ".$edad);
else
echo ($nombre." es menor de edad, ya que tiene ".$edad);
?>
</body>
</html>