Jump to content

Recommended Posts

Hello all I have been looking around the net to find some code and I find that I'm stumped.

What I'm looking to do is get the ip address (I know how to do this) of the person coming

to the page. Once I have this I would like to find out what country/city they came from.

 

I have seen some things out there that say I can do this but I was wondering if there was

a fairly easy PHP why to do this. The one PHP class that I did find said I was from Ottawa,

Canada and I live in Nova Scotia, Canada.

 

Any help would be great, thanks!

 

Stephen

Link to comment
https://forums.phpfreaks.com/topic/86734-solved-ip-location/
Share on other sites

The one PHP class that I did find said I was from Ottawa,

Canada and I live in Nova Scotia, Canada.

If you don't like that level of inaccuracy, then don't even start this task/project. IP geo location databases are more accurate at specifying the country (and not the city).

 

In case you're not aware, users could be coming from IP's that are not really where they are located (i.e. they could use a proxy like http://www.proxywb.com). So, what is it you're intending to do?

 

This is a free IP (country) database:

http://software77.net/cgi-bin/ip-country/geo-ip.pl

 

There's paid services that you can use in real time. MaxMind boasts about an 80% accuracy (for the US):

http://www.maxmind.com/app/city

 

http://www.fraudlabs.com/ip2location.aspx

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/86734-solved-ip-location/#findComment-443338
Share on other sites

I was making a stats tracking page for a website and they asked me is I could display such information for them.

So I'll just download the free DB and work with it, I figured there would be a high level inaccuracy. I guess at least

I'll give it a try and see if they like it.

 

Thanks for the help all

 

Stepehn

Link to comment
https://forums.phpfreaks.com/topic/86734-solved-ip-location/#findComment-443417
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.