I am building my log system, for my software in php.
Data collection via: https://ipinfo.io/
As shown in the screenshot, just make a json_decode to read them.
Only problem for the privacy object that I can't show:
example working with for example the city parameter:
//Gets the IP Address from the visitor
$PublicIP = $_SERVER['REMOTE_ADDR'];
//Uses ipinfo.io to get the location of the IP Address, you can use another site but it will probably have a different implementation
$json = file_get_contents("http://ipinfo.io/$PublicIP/geo");
//Breaks down the JSON object into an array
$json = json_decode($json, true);
$city = $json['city'];
echo $city;
instead when I have to go into privacy, it doesn't give me anything back, what am I doing wrong?
$PublicIP = $_SERVER['REMOTE_ADDR'];
$json = file_get_contents("http://ipinfo.io/$PublicIP/geo");
$json = json_decode($json, true);
$vpn = $json["privacy"]["vpn"];
echo $vpn