public function authenticate() { if ($_SERVER['REQUEST_METHOD'] !== 'POST') { redirect('index.php?page=login'); } $email = trim($_POST['email'] ?? ''); $password = $_POST['password'] ?? ''; if ($email === '' || $password === '') { setFlashMessage('error', 'Email and password are required.'); redirect('index.php?page=login'); } $pdo = getDBConnection(); $stmt = $pdo->prepare(" SELECT u.*, r.name AS role_name FROM users u LEFT JOIN roles r ON r.id = u.role_id WHERE u.email = :email LIMIT 1 "); $stmt->execute(['email' => $email]); $user = $stmt->fetch(); if (!$user) { setFlashMessage('error', 'Invalid login credentials.'); redirect('index.php?page=login'); } if (!password_verify($password, $user['password'])) { setFlashMessage('error', 'Invalid login credentials.'); redirect('index.php?page=login'); } loginUser($user); redirect('index.php?page=dashboard'); } Page Not Found - Education Institute CRM

404

Page Not Found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.