Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Formularios usables</title>
  6.     <link rel="stylesheet" type="text/css" href="estilos.css">
  7. </head>
  8. <body>
  9.  
  10.     <h1>Formularios usables</h1>
  11.  
  12.     <?php
  13.     include "funciones.php";
  14.  
  15.     $archivo = "usuarios.txt";
  16.     $errores=[];
  17.    
  18.         if (! $_POST) {
  19.         include "formulario.php";
  20.     } else {
  21.         include "validaciones.php";
  22.              if ($errores) {
  23.             //mostrar_errores($errores);
  24.             include "formulario.php";
  25.  
  26.             } else {
  27.             echo "Todo correcto, se ha guardado el nuevo usuario";
  28.  
  29.             $fuente = fopen($archivo ,"a+");
  30.            
  31.             $reserva = $_POST['nombre'] . '|' . $_POST['email'] . '|' . $_POST['clave1']  . "\n";
  32.             fwrite($fuente , $reserva);
  33.             fclose($fuente);
  34.             echo "<h2> Usuario Guardado </h2>";
  35.    
  36.        
  37.         }
  38.        
  39.         }
  40.        
  41.        
  42.  
  43.  
  44.     ?>
  45.  
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement