Contenidos
Formulario (index.php)
1 2 3 4 5 |
<form action="examplepost.php" method="post"> Nombre: <input type="text" name="nombre" /><br /> Edad: <input type="text" name="edad" /><br /> <input type="submit" name="submit" value="Enviar" /> </form> |
Código en PHP con método POST (es una prueba de concepto, el código es inseguro) (examplepost.php)
1 |
<?php echo htmlspecialchars($_POST['nombre']); ?> tiene <?php echo (int)$_POST['edad']; ?> años. |