1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can anyone help me to retrieve the Internet Service Provider for the IP in php

Discussion in 'PHP & Perl' started by smashingcreativez, Apr 6, 2016.

  1. smashingcreativez

    smashingcreativez Registered Member

    Joined:
    Dec 5, 2014
    Messages:
    91
    Likes Received:
    7
    Occupation:
    Saiyan
    Location:
    Earth
    Hi can anyone help me to retrieve the ISP in php . I have found a database for isp in maxmind https://www.maxmind.com/en/geoip2-isp-database
    But i don't know how to integarte tat in php Or is tere any opensource API for integarting ISP in php .
    Does anyone have a code or some tutorials for integrating it .
    Thank you
     
  2. AdvancedDevelopment

    AdvancedDevelopment BANNED BANNED

    Joined:
    Mar 23, 2016
    Messages:
    91
    Likes Received:
    28
    Impossible in pure php however i've got a rather blackhat script that does exactly this, Ip, Location, Isp, Country+Flag.. i'll add you on skype.
     
  3. stevenvega

    stevenvega Newbie

    Joined:
    Oct 10, 2015
    Messages:
    16
    Likes Received:
    0
    Occupation:
    Sysadmin By Day
    Location:
    California
    Remember that IP can only give you so much.

    The location of an IP address is the location that owner of the block set. Usually a mailing address not the location of the computer using it.
    The ISP is precise either, you can just find the owner of the block of IPs. That doesn't guarantee the owner is the is the ISP

    If someone is promising they can give you an address for an IP address alone, like locate a phone with an IP. They are lying.
     
  4. Des_cartes

    Des_cartes Junior Member

    Joined:
    Jan 19, 2012
    Messages:
    160
    Likes Received:
    64
  5. redarrow

    redarrow Elite Member

    Joined:
    Apr 1, 2013
    Messages:
    4,357
    Likes Received:
    994
    Last edited: May 11, 2016
  6. AdvancedDevelopment

    AdvancedDevelopment BANNED BANNED

    Joined:
    Mar 23, 2016
    Messages:
    91
    Likes Received:
    28
    I'm guessing you never read the ops original post properly and never understood mine then put 2 + 2 together and got 5. Please reread the original post then post back. He wants to know how to get the isp name, not a hostname or IP.
     
  7. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    971
    Likes Received:
    680
    Occupation:
    Web/Bot Developer
    This is how it would be done using the Maxmind GeoIP DB in PHP:
    Code:
    <?php
    
    require_once 'vendor/autoload.php';
    use GeoIp2\Database\Reader;
    
    $reader = new Reader('/usr/local/share/GeoIP/GeoIP2-ISP.mmdb');
    
    $record = $reader->isp('128.101.101.101');
    
    print($record->isp . "\n");
    
    ?>
    
     
    Last edited: May 17, 2016
  8. MrBlue

    MrBlue Senior Member

    Joined:
    Dec 18, 2009
    Messages:
    971
    Likes Received:
    680
    Occupation:
    Web/Bot Developer
    Double post. Please delete.
     
    Last edited: May 17, 2016
  9. Anakyl

    Anakyl Regular Member

    Joined:
    Mar 29, 2016
    Messages:
    211
    Likes Received:
    41
    Gender:
    Male
    Home Page:
  10. cloaking

    cloaking Registered Member

    Joined:
    Aug 21, 2015
    Messages:
    94
    Likes Received:
    31
    Just copy/paste this, and you should be good to go!

    PHP:
    $ip $_SERVER['REMOTE_ADDR'];
    $geoip json_decode(file_get_contents("http://ip-api.com/json/$ip"),true);
    echo (
    $geoip && $geoip["status"] == "success") ? $geoip["isp"] : "Your ISP";
    Note:
    • ip-api.com blocks IP addresses performing over 150 requests per minute
    • You can then unban your IP from their website or purchase a paid package
     
    • Thanks Thanks x 1