/ Published in: PHP

Ejemplo dos de formulario
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<html><!--se puede incluir html en un php--> <head> <title> Formulario </title> </head> <body> <form name="prueba" action="formulario2.php" method="POST"><!--generamos el formulario, se va a recargar por eso el action es "formulario2.php"--> Nombre<input name="nombre" type="text" ><br /> Contraseña <input name="contra" type="password"><br /> <input type="submit" name="btn_envio" value="Entrar"> </form> </body> </html> <?php if (isset($_POST['btn_envio'])){//valida que se haya presionado enviar y generado los ÃÂndices en el Arreglo $_POST con las variables del formulario echo "debes llenar todos los <a href='formulario.htm'>campos</a> "; } else{ }else { echo "debes llenar el formulario"; } ?>
URL: www.alejandrolopezlopez.com.mx/e-virtual
Comments
