Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Formularios usables</title>
- <link rel="stylesheet" type="text/css" href="estilos.css">
- </head>
- <body>
- <h1>Formularios usables</h1>
- <?php
- include "funciones.php";
- $archivo = "usuarios.txt";
- $errores=[];
- if (! $_POST) {
- include "formulario.php";
- } else {
- include "validaciones.php";
- if ($errores) {
- //mostrar_errores($errores);
- include "formulario.php";
- } else {
- echo "Todo correcto, se ha guardado el nuevo usuario";
- $fuente = fopen($archivo ,"a+");
- $reserva = $_POST['nombre'] . '|' . $_POST['email'] . '|' . $_POST['clave1'] . "\n";
- fwrite($fuente , $reserva);
- fclose($fuente);
- echo "<h2> Usuario Guardado </h2>";
- }
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement