İyi akşamlar,

Ben bir login/register php scripti yapmaya çalışıyorm yalnız session.php dosyasına extend edilmiş bir function dahil etmek istedigimde hata alıyorum.

Bu hatanın nedeni nedir acaba?

Session.php:




session_start();
require_once 'auth.php';
$cuser = new Auth();

if (!isset($_SESSION['user'])) {
header('location:index.php'); // Redirect To User If User Is Not Logged In
die;
}

$cemail = $_SESSION(['user']);

$data = $cuser->currentUser($cemail);



Auth.php:




require_once 'databese.php';

class Auth extends Database
{
// BEGIN: New User Registiration //
public function register($name, $email, $password)
{
$sql = "INSERT INTO users (name, email, password) VALUES (:name, :email, :pass)";
$stmt = $this->conn->prepare($sql);
$stmt->execute(['name' => $name, 'email' => $email, 'pass' => $password]);

return true;
}
// END: New User Registiration //
// BEGIN: Checking If The User Already Exist In Database //
public function user_exist($email)
{
$sql = "SELECT email FROM users WHERE email = :email";
$stmt = $this->conn->prepare($sql);
$stmt->execute(['email' => $email]);
$result = $stmt->fetch(PDO::FETCH_ASSOC);

return $result;
}
// END: Checking If The User Already Exist In Database //
// BEGIN: Logged In Existing User //
public function login($email)
{
$sql = "SELECT email, password FROM users WHERE email = :email AND deleted !=0";
$stmt = $this->conn->prepare($sql);
$stmt->execute(['email' => $email]);
$row = $stmt->fetch(PDO::FETCH_ASSOC);

return $row;
}
// END: Logged In Existing User //
// BEGIN: Logged In Current User //
public function currentUser($email)
{
$sql = "SELECT * FROM users WHERE email = :email AND deleted != 0";
$stmt = $this->conn->prepare($sql);
$stmt->execute(['email' => $email]);
$row = $stmt->fetch(PDO::FETCH_ASSOC);

return $row;
}
// END: Logged In Current User //
}



Dashboard.php:



require_once 'assets/includes/session.php';
define('TITLE', "Dashboard");
include 'assets/layouts/header.php';
?>








Content







include 'assets/layouts/footer.php';

?>



Aldıgım hata: