hopefully working now
This commit is contained in:
parent
00f4d245ef
commit
f8a510d190
15
index.php
15
index.php
@ -16,14 +16,25 @@ require_once 'config.php';
|
||||
|
||||
$paths_to_check = array();
|
||||
|
||||
|
||||
$page = basename($_SERVER['QUERY_STRING']);
|
||||
|
||||
$nav = include_ob("$template_dir/navigation.html");
|
||||
|
||||
|
||||
if($page_dir == "global") {
|
||||
if(!file_exists("$page_dir/index.html")) {
|
||||
$page_file = "$page_dir/login.html";
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($page)){
|
||||
if(isset($_SESSION['user_id'])){
|
||||
$page = 'index';
|
||||
}
|
||||
else{
|
||||
$page = 'login';
|
||||
}
|
||||
}
|
||||
|
||||
// Check if user is logged in
|
||||
if (isset($_SESSION['user_id'])) {
|
||||
@ -37,6 +48,8 @@ $paths_to_check[] = "pages/global";
|
||||
|
||||
$page_file = "$template_dir/404.html";
|
||||
|
||||
|
||||
|
||||
foreach($paths_to_check as $page_dir){
|
||||
$page_file_tmp = "$page_dir/$page.html";
|
||||
if(file_exists($page_file_tmp)){
|
||||
|
@ -1,2 +0,0 @@
|
||||
<!--PAGENAME=You dont have any rights-->
|
||||
<h1>Watch something</h1>
|
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
global $mysqli;
|
||||
// Handle login form submission
|
||||
$email = $_POST['email'];
|
||||
$password = $_POST['password'];
|
||||
|
Loading…
Reference in New Issue
Block a user