prepare("INSERT INTO activity_logs (user_id, action, ip_address) VALUES (?, 'Login', ?)") ->execute([$_SESSION['user_id'], $_SERVER['REMOTE_ADDR']]); } catch (Exception $e) { /* Ignore logging error */ } switch ($role) { case 'Admin': case 'Super Admin': case 'Manager': header('Location: /admin/index.php'); break; case 'Dealer': header('Location: /dealer/index.php'); break; case 'Customer': case 'Buyer': header('Location: /buyer/index.php'); break; default: header('Location: /index.php'); } exit; } else { $error = "Invalid username or password"; } } ?> Login - Car Market

Welcome Back