Advertisement
xlujiax

ControllerValidarAcceso

Dec 3rd, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement