http://www.hostip.info/use.html
In short, you need to include in the get the IP address of the user hitting your site in a URL passed variable like: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.
Code:$ip = $_SERVER['REMOTE_ADDR']; $url = 'http://api.hostip.info/get_html.php?ip=$ip';









Reply With Quote


Bookmarks