Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 20, 2021 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/aa660a819e020383f1ba3e16c5255cf4 to your computer and use it in GitHub Desktop.
Save parzibyte/aa660a819e020383f1ba3e16c5255cf4 to your computer and use it in GitHub Desktop.
<?php
# Simple validación
if (!isset($_POST["correo"]) || !isset($_POST["palabraSecreta"])) {
exit("Faltan datos");
}
$correo = $_POST["correo"];
$palabraSecreta = $_POST["palabraSecreta"];
include_once "funciones.php";
$valor = hacerLogin($correo, $palabraSecreta);
if ($valor == 0) {
# Correo o contraseña incorrectos
header("Location: formulario_login.php?mensaje=Usuario o contraseña incorrectos. Se ha registrado el intento fallido");
} else if ($valor == 2) {
header("Location: formulario_login.php?mensaje=Límite de intentos alcanzado. Contactar a administrador para reiniciar");
} else {
#Todo bien. Iniciar sesión y redireccionar a la página
iniciarSesionDeUsuario();
header("Location: usuarios.php");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment