namespace App; session_start(); if (!isset($_GET['T'], $_GET['editpost'])) { header('Location:/index.php'); } require_once 'vendor/autoload.php'; require_once 'app/config.php'; require_once 'app/capsule.php'; use App\Controller\ThreadController; use App\Controller\UserController as User; use Illuminate\Database\Capsule\Manager as Capsule; $con = mysqli_connect($hostname, $dbusername, $dbpassword, $db); $UserController = new User(); $ThreadController = new ThreadController(); $User = User::User(); if (isset($_GET['logout'])) { if ($_GET['logout'] == true) { $UserController->logout(); } } if (isset($_SESSION['username'], $_SESSION['id'])) { $loggedin = true; } if (isset($_GET['logout'])) { if ($_GET['logout'] == true) { $UserController->logout(); header('Location:/index.php'); } }
<?php namespace App; session_start(); require_once 'vendor/autoload.php'; require_once 'app/config.php'; require_once 'app/capsule.php'; use App\Controller\ThreadController; use App\Controller\UserController; use Illuminate\Database\Capsule\Manager as Capsule; $con = mysqli_connect($hostname, $dbusername, $dbpassword, $db); $UserController = new UserController(); $ThreadController = new ThreadController(); $User = UserController::User(); if (!isset($_GET['C'], $_GET['add_thread'])) { header('Location:/index.php'); } elseif ($_GET['add_thread'] != 'true') { header('Location:/index.php'); } if (isset($_GET['logout'])) { if ($_GET['logout'] == true) { $UserController->logout(); } } if (isset($_SESSION['username'], $_SESSION['id'])) { $loggedin = true; } if (isset($_GET['C'])) { $category_id = $_GET['C']; $threads = $ThreadController->show($category_id);
<?php namespace App; session_start(); require_once 'vendor/autoload.php'; require_once 'app/config.php'; require_once 'app/capsule.php'; use App\Controller\ThreadController; use App\Controller\UserController; use Illuminate\Database\Capsule\Manager as Capsule; $con = mysqli_connect($hostname, $dbusername, $dbpassword, $db); $UserController = new UserController(); $ThreadController = new ThreadController(); $User = $UserController::User(); if (isset($_GET['logout'])) { if ($_GET['logout'] == true) { $UserController->logout(); } } if (isset($_SESSION['username'], $_SESSION['id'])) { $loggedin = true; } if (isset($_GET['C'])) { $category_id = $_GET['C']; $threads = $ThreadController->show($category_id); } elseif (isset($_GET['T'])) { $thread_id = $_GET['T']; $posts = $ThreadController->showthread($thread_id); } else { header('Location:/index.php');