renamed main.php to index.php
This commit is contained in:
18
index.php
Normal file
18
index.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'config.php';
|
||||
|
||||
// Check if user is logged in
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
include 'pages/login.html';
|
||||
} 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);
|
||||
|
||||
// Include the index page with user information
|
||||
include 'pages/index.html';
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user