Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.

Register Today on DNForum IT'S FREE!

Results 1 to 3 of 3

Thread: GEO-IP with PHP

  1. #1
    Platinum Lifetime Member
    darmar's Avatar
    Join Date
    Dec 2006
    Location
    Zagreb, Croatia
    Posts
    99
    DNF$
    370
    Bank
    0
    Total DNF$
    370
    Donate  

    Question GEO-IP with PHP

    Hi


    I need a little help.

    I'm using
    http://api.hostip.info/country.php
    to fetch the locale of the visitor.

    I'd like to fetch this through my PHP script, with something like this:
    $locale = @file("http://api.hostip.info/country.php");

    But, then this web service doesn't fetch my visitors location, but my web server location.

    I need tihs to programatically set the default language for my multilanguage website.

    Does anybody have any idea how to "fix" this ?


    Thank you

  2. #2
    Platinum Lifetime Member

    Join Date
    Oct 2003
    Location
    michigan
    Posts
    259
    DNF$
    1,126
    Bank
    0
    Total DNF$
    1,126
    Donate  

    Re: GEO-IP with PHP

    http://www.hostip.info/use.html

    Simple GET
    That said, there is an easy HTTP oriented API to locate IP addresses and Geocode them. If you don't supply the "?ip=aa.bb.cc.dd" bit, then the ip address lookup of the calling machine will be located instead (here, the aa,bb,cc,dd are decimal digits). If you add &position=true to the end of the URL then latitude and longitude will be returned also. Both HTML and XML formats are supplied for your convenience.
    In short, you need to include in the get the IP address of the user hitting your site in a URL passed variable like:

    Code:
    $ip = $_SERVER['REMOTE_ADDR'];
    $url = 'http://api.hostip.info/get_html.php?ip=$ip';
    If it sounds too good to be true, post it on DNForum and you'll find some suckers!

  3. #3
    Platinum Lifetime Member
    darmar's Avatar
    Join Date
    Dec 2006
    Location
    Zagreb, Croatia
    Posts
    99
    DNF$
    370
    Bank
    0
    Total DNF$
    370
    Donate  

    Re: GEO-IP with PHP

    Yup, that's it, I forgot about it.... I'm screeming to myself now - RTFM !!!!

    Thanks !

Similar Threads

  1. F$ for Membership Upgrade with Bonus
    By wendy in forum DNF$ Sales/Domain Auctions
    Replies: 35
    Last Post: 05-11-2007, 11:39 PM
  2. 14 Super PHP scripts, Ringtone site, and Photorating website!
    By NavySeals91 in forum DNF$ Sales/Domain Auctions
    Replies: 21
    Last Post: 07-06-2006, 07:09 PM
  3. a nice one: mysqlphp.com
    By in forum Domain Name Appraisal Discussion
    Replies: 2
    Last Post: 04-27-2002, 04:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com