Created
May 27, 2025 16:14
-
-
Save Anders87x/4aa4bbe5a706ad87b70719e0b75673f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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