btsander
Member
Posted 1 year ago #
I'm trying to get this to work but it looks like the instructions might be missing a piece. How do yo provide an IP as input??
it looks like you'd want to do it on this line:
$ip2country_info = ip2country_info($ip2country->country_code);
i tried:
$ip2country_info = ip2country_info('174.100.104.123');
didn't work.
Thanks
http://wordpress.org/extend/plugins/ip2country/
Did you added db-dump to your database as it was written on installation page?
btsander
Member
Posted 1 year ago #
yes... it looks like I get a lat and long only but it's actually way off. is the syntax I wrote correct?
$ip2country_info = ip2country_info('174.100.104.123');
Code should be like this:
$ip2country = ip2country('212.113.46.148');
$ip2country_info = ip2country_info($ip2country->country_code);
echo ' iso_code_2: '.$ip2country_info->iso_code_2;
echo ' iso_code_3: '.$ip2country_info->iso_code_3;
echo ' iso_country: '.$ip2country_info->iso_country;
echo ' country: '.$ip2country_info->country;
echo ' lat: '.$ip2country_info->lat;
echo ' lon: '.$ip2country_info->lon;
Sorry for not replying same day, was busy.