1
0
mirror of synced 2025-12-28 00:23:25 +00:00

feat(login/register) blabla

This commit is contained in:
Valentin
2024-06-10 18:19:34 +02:00
parent f6570e074c
commit 10825d7598
17 changed files with 243 additions and 38 deletions

View File

@@ -1,5 +1,20 @@
<?php include 'structure/header.php'; ?>
<?php include 'structure/navbar.php'; ?>
<?php
session_start();
$page = basename($_SERVER['PHP_SELF']);
if (!isset($_SESSION['user_id']) && $page !== 'login.php' && $page !== 'register.php') {
header("Location: login.php");
exit();
} else if (isset($_SESSION['user_id']) && ($page === 'login.php' || $page === 'register.php')) {
header("Location: index.php");
exit();
}
include 'structure/header.php';
include 'structure/navbar.php';
include 'services/db.php';
?>
<main class="container mt-5">
<?php include $content; ?>