watch.twip-network.org/index.php

23 lines
613 B
PHP
Raw Normal View History

2024-01-20 16:04:27 +01:00
<?php
session_start();
require_once 'config.php';
// Check if user is logged in
if (!isset($_SESSION['user_id'])) {
2024-01-20 18:23:08 +01:00
include 'login.php';
2024-01-20 16:04:27 +01:00
} else {
// Fetch user details
$user_id = $_SESSION['user_id'];
$query = "SELECT * FROM users WHERE id = $user_id";
$result = mysqli_query($mysqli, $query);
$user = mysqli_fetch_assoc($result);
2024-01-20 18:00:30 +01:00
// Include the appropriate HTML based on user's status
if ($user['isAdmin'] == 1) {
include 'pages/index_admin.html'; // Custom HTML for Admin
} else {
include 'pages/index_user.html'; // Custom HTML for regular user
}
2024-01-20 16:04:27 +01:00
}
?>