Hello again stackoverflow!
So i build this script:
<?php
$xmlurl = 'http://api.ipinfodb.com/v2/ip_query.php?key=apikey&ip=127.0.0.100&timezone=false';
$xml = simplexml_load_file($xmlurl);
if($xml->status == 'OK'){
echo '<br>'. $xml->CountryName;
echo '<br>'. $xml->RegionName;
echo '<br>'. $xml->City;
}
else
{
echo $xml->status;
}
?>
This is returning a white page?
No errors, no warnings…
But while i do print_r it does show an array?
The names of the elements and thus the properties of the result of your
simplexml_load_filecall are case-sensitive. Therefore you should change the negative branch code to:(notice the capital S).
The same applies to your if condition: