$ip, 'timestamp' => time(), ]; // Save updated counter data file_put_contents($counterFile, json_encode($counterData, JSON_PRETTY_PRINT)); } // Increment counter and redirect incrementCounter(); header("Location: $targetURL"); exit; ?>