I added a namespace to my user.php
file, this causes an error to be displayed :
Fatal error: Uncaught Error: Class 'User' not found in /var/www/html/login.php:9 Stack trace: #0 {main} thrown in /var/www/html/login.php on line 9
I tried changing "new Database\Database();"
to "new \PDO();"
but that causes another error which I've been unable to resolve after spending hours on google, if anyone could help I'd much appreciate it, thank you.
user.php
<?php
namespace User;
// 'user' object
class User
{
login.php
<?php
include_once "config/core.php";
$page_title = "Login";
$require_login = false;
include_once "login_checker.php";
include_once "config/database.php";
include_once "objects/user.php";
include_once "libs/php/pw-hashing/passwordLib.php";
$database = new Database\Database();
$db = $database->getConnection();
$user = new User($db);