Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ControllerValidarAcceso
- <?php
- session_start();
- include 'ControllerUsuario.php';
- $pro = new ControllerUsuario();
- IF($_POST["username"] == "" && $_POST["password"]=="" ){
- header('Location:../index.php');
- } else {
- $_SESSION['usu'] = $_POST["username"];
- $_SESSION['cla'] = $_POST["password"];
- $data=$pro->ControllerValidarUsuario($_POST["username"], ($_POST["password"]));
- foreach($data as $fila){
- $_SESSION['user'] = $fila["Username"];
- $_SESSION['pass'] = $fila["Password"];
- $_SESSION['nomb'] = $fila["Nombres"];
- $_SESSION['ape'] = $fila["Apellidos"];
- }
- //Validando
- if(count($data) == 0)
- header('Location:../index.php');
- else {
- header('Location:../view/principal.php');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement