15 lines
338 B
PHP
15 lines
338 B
PHP
<?php
|
|
// index.php - Main router
|
|
|
|
if (session_status() == PHP_SESSION_NONE) {
|
|
session_start();
|
|
}
|
|
|
|
if (isset($_SESSION['user_id'])) {
|
|
// User is logged in, redirect to the dashboard
|
|
header('Location: dashboard.php');
|
|
} else {
|
|
// User is not logged in, redirect to the login page
|
|
header('Location: login.php');
|
|
}
|
|
exit(); |