$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? ''; if (empty($userAgent) || preg_match('/bot|curl|spider|crawl|wget|http/i', $userAgent)) { http_response_code(403); exit("Access Denied"); }