IP to Location script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    IP to Location script

    For all those who cant import those large tables for geo locating. I made this grabber. it uses curl and fetch results from remote server. Script returns array with country name, link to country flag and country shorthand name ( information is based on user IP).
    PHP Code:
    // use it like this
    $array = require 'path/to/geoip_curl.php';

    //country name
    $name $array['NAME'];

    //country flag
    $flag_url $array['IMG'];

    //short name
    $abbr $array['ABBR'];

    //show results
    echo 'Country: ' $name "[$abbr]";
    echo 
    "<img src='{$flag_url}' />"
    NOTE: I dont know for how long will this script work.

    I tested it on my PC and phone and it shows correct results. I hope that it helps someone.
    Attached Files
    PHP Code:
    $("#mfreak").find(".head brain").clone(); 
    Progress:
    Code:
    [|||___________________________] : 5%
    Output:
    Code:
    Memory limit reached, unable to complete operation.
    Support answer:
    Code:
    Try using a super uber strong mega computer to reach at least 10%.

    #2
    or you can try this one, choose what type of geolocation you want.. here's the 2 script demo



    and




    and here is the script
    Attached Files

    http://wapx.amob.com
    Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

    Comment


      #3
      how to put it in profile in community site teach please?

      Comment


        #4
        Wapxtech . , . When i am enter it. , . My result is unkown city and unknown cuntry . . .why that .
        Iam srilankan and location tangalle

        Comment


          #5
          Originally posted by slcash View Post
          Wapxtech . , . When i am enter it. , . My result is unkown city and unknown cuntry . . .why that .
          Iam srilankan and location tangalle
          demo wont show my location eather. at least my script showed me that i am browsing from bosnia.
          PHP Code:
          $("#mfreak").find(".head brain").clone(); 
          Progress:
          Code:
          [|||___________________________] : 5%
          Output:
          Code:
          Memory limit reached, unable to complete operation.
          Support answer:
          Code:
          Try using a super uber strong mega computer to reach at least 10%.

          Comment


            #6
            use geo.php, its maxmind geolocation =D they claim that they are the most reliable geoloc database, and for me its true. both of you tries geoloc.php, why dont you try geo.php? they have different api geoloc.php is a free api to geolocation database, thats why their database is not that reliable.

            geo.php completes your needs, not only the geolocation but also the ISP =D

            http://wapx.amob.com
            Applications, Games, Wallpapers, Ringtones, Videos, Themes, Screensaver and More!!!

            Comment


              #7
              Originally posted by wapxtech View Post
              use geo.php, its maxmind geolocation =D they claim that they are the most reliable geoloc database, and for me its true. both of you tries geoloc.php, why dont you try geo.php? they have different api geoloc.php is a free api to geolocation database, thats why their database is not that reliable.

              geo.php completes your needs, not only the geolocation but also the ISP =D
              yep, its true maxmind is awesome. But for country and flag i stick to my grabber.
              PHP Code:
              $("#mfreak").find(".head brain").clone(); 
              Progress:
              Code:
              [|||___________________________] : 5%
              Output:
              Code:
              Memory limit reached, unable to complete operation.
              Support answer:
              Code:
              Try using a super uber strong mega computer to reach at least 10%.

              Comment

              Working...
              X