<?php
    require('conexion.php');
    session_start();

    /* $usuario = $_POST['username'];
    $password = $_POST['password']; */

    $usuario = mysqli_real_escape_string($mysqli, $_POST['username']);
    $password = mysqli_real_escape_string($mysqli, $_POST['password']);

    $consulta =$mysqli -> query("SELECT COUNT(*) AS contar FROM xeryus.Usuarios WHERE Alias = '$usuario' AND Password = '$password'");
    $rowUsuario=mysqli_fetch_array($consulta);

    if($rowUsuario['contar'] > 0){
        $_SESSION['username'] = $usuario;
        header("location: ../index.php");
    }else{
        header("location: ../login.php");
    }

?>
