WordPress.org

Ready to get started?Download WordPress

Forums

Ip2country
Inserting IP (4 posts)

  1. btsander
    Member
    Posted 2 years 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/

  2. webvitaly
    Member
    Plugin Author

    Posted 2 years ago #

    Did you added db-dump to your database as it was written on installation page?

  3. btsander
    Member
    Posted 2 years 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');

  4. webvitaly
    Member
    Plugin Author

    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags