Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Anders87x/4aa4bbe5a706ad87b70719e0b75673f6 to your computer and use it in GitHub Desktop.

Select an option

Save Anders87x/4aa4bbe5a706ad87b70719e0b75673f6 to your computer and use it in GitHub Desktop.
<?php
require_once("../../config/conexion.php");
// Iniciar la sesión
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
// Si hay una sesión activa, redirigir al Home
if (isset($_SESSION["usu_id"])) {
header("Location: " . Conectar::ruta() . "view/Home/");
exit();
} else {
// Si no hay sesión, cargar el HTML del login
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Acceso al sistema</title>
<!-- Aquí tus links a CSS, favicon, etc. -->
</head>
<body>
<!-- Tu formulario de login va aquí -->
<h2>Iniciar sesión</h2>
<form method="POST" action="">
<input type="text" name="usu_correo" placeholder="Correo">
<input type="password" name="usu_pass" placeholder="Contraseña">
<input type="hidden" name="enviar" value="si">
<button type="submit">Acceder</button>
</form>
</body>
</html>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment