Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if($_SESSION['logueado'] != "SI"){
- header('location: login.php');
- exit();
- }
- $user = $_SESSION['usuario'];
- //si ya esta logueado me conecto a la base de datos
- include 'conn.php';
- <?php
- session_start();
- include 'conn.php';
- if(isset($_POST['login'])){
- if(!empty($_POST['pass'])){
- $stmt = $conn->prepare("SELECT * FROM usuarios WHERE pass=:pass");
- $stmt->execute(array(':pass'=>$_POST['pass']));
- $fila = $stmt->fetch();
- if($fila > 0){
- $_SESSION['logueado'] = "SI";
- $_SESSION['usuario'] = $fila['nombre'];
- header('location: index.php');
- } else {
- echo '<div class="error"><img class="image" src="icons/exclamation.png"> Contraseña incorrecta. Consulte con el administrador si no la recuerda.</div>';
- }
- }
- }
Add Comment
Please, Sign In to add comment