prepare("SELECT * FROM users WHERE username = ? LIMIT 1"); $stmt->execute([$username]); $user = $stmt->fetch(); if (!$user || !password_verify($password, $user['password_hash'])) { throw new RuntimeException('로그인 정보가 올바르지 않습니다.'); } clear_login_attempts($username); login_user($user, $remember); header('Location: /dashboard.php'); exit; } catch (Throwable $e) { $error = $e->getMessage(); } } ?>