Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. include "funciones.php";
  2.     $archivo = "usuarios.txt";
  3.    
  4.     $errores=[];
  5.         if (! $_POST) {
  6.         include "formulario.php";
  7.     } else {
  8.         include "validaciones.php";
  9.              if ($errores) {
  10.             //mostrar_errores($errores);
  11.             include "formulario.php";
  12.  
  13.         } else {
  14.             echo "Todo correcto, se ha guardado el nuevo usuario";
  15.  
  16.         $fuente = fopen($archivo ,"a+");
  17.             if(is_writable($archivo)){
  18.             $reserva = $_POST['nombre'] . '|' . $_POST['email'] . '|' . $_POST['clave1'] . '|' . $_POST['clave2'] . "\n";
  19.             fwrite($fuente , $reserva);
  20.             fclose($fuente);
  21.             echo "<h2> Usuario Guardado </h2>";
  22.             } else  {
  23.             echo "Usuario no guardado";
  24.         }
  25.        
  26.         }
  27.        
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement