SHARE
TWEET

Untitled

a guest Dec 30th, 2018 127 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $fp = fopen("users/${dirname}/validar.php", "w") or die("Error al intentar abrir el archivo!");
  3. fwrite($fp, '<?php
  4.  
  5. $miuser = 'ChristianHz';
  6. $mipass = 'seraz90';
  7.  
  8. if(isset($_POST['login'])) {
  9.     $usuario = $_POST['usuario'];
  10.     $pass = $_POST['password'];
  11.     if ($usuario == $miuser and $pass == $mipass ) {
  12.         if (isset($_POST['remember'])) {
  13.             setcookie('usuario', $usuario, time()+60*60*7);
  14.             setcookie('passowrd', $pass, time()+60*60*7);
  15.         }
  16.         session_start();
  17.         $_SESSION['usuario'] = $usuario;
  18.         header('location:panel');
  19.     } else {
  20.         echo '<p>usuario o clave son incorrectos</p>';
  21.     }
  22. } else {
  23.     header('location: login');
  24. }
  25.  
  26. ?>');
  27. fclose($fp);
  28. ?>
  29.    
  30. <?php
  31. $nombre = "Juan";
  32. $variable1 = "Mi nombre es $nombre";
  33. $variable2 = 'Mi nombre es $nombre';
  34.  
  35. echo $variable1; //Imprime: Mi nombre es Juan
  36. echo $variable2; //Imprime: Mi nombre es $nombre
  37. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top