SHARE
TWEET

ControllerValidarAcceso

xlujiax Dec 3rd, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //ControllerValidarAcceso
  2. <?php
  3. session_start();
  4. include 'ControllerUsuario.php';
  5. $pro = new ControllerUsuario();
  6. IF($_POST["username"] == "" && $_POST["password"]=="" ){
  7.     header('Location:../index.php');
  8. } else {
  9.  
  10.     $_SESSION['usu'] = $_POST["username"];
  11.     $_SESSION['cla'] = $_POST["password"];
  12.  
  13.     $data=$pro->ControllerValidarUsuario($_POST["username"], ($_POST["password"]));
  14.     foreach($data as $fila){
  15.         $_SESSION['user'] = $fila["Username"];
  16.         $_SESSION['pass'] = $fila["Password"];
  17.         $_SESSION['nomb'] = $fila["Nombres"];
  18.         $_SESSION['ape'] = $fila["Apellidos"];
  19.     }  
  20.     //Validando
  21.     if(count($data) == 0)
  22.         header('Location:../index.php');
  23.     else {
  24.         header('Location:../view/principal.php');
  25.     }
  26. }
  27. ?>
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
 
Top