I.P geographic location script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

I.P geographic location script

Post by hame22 »

Hi not sure if this is the right forum to post this question but it is php related.

I have a php script that uses a users IP address to determine whether they come from UK, USA or other country

The problem that I am having is that some users in the uK are being seen as coming from the USA.

What is the reason behind this and can this be solved??

I have heared some uk users maybe using US ISP's, could this be the case?

thanks in advance
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

There are a ton of reasons why this could be :) As a matter of practice. DO NOT relay on IP addresses... :)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

IP addresses don't always have ANY geographic correlation to their user.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Some ISP's shuffle IP during sessions. Some proxy servers do the same thing. IP are not a very reliable means of determining geographic positioning.
User avatar
bokehman
Forum Regular
Posts: 509
Joined: Wed May 11, 2005 2:33 am
Location: Alicante (Spain)

Post by bokehman »

The most likely reason is that their host is America OnLine
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

Post by hame22 »

Ok that is exactly what I though.

Are there any alternative methods which I could use to do the same thing as using the I.p.s?

thanks in advance
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Nope.

What you can do however is ask the user to supply their geographic location.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Ask them?
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

astions wrote:Ask them?

Code: Select all

<form method="post" action="location.php">
What is your location?
<input type="text" name="location" />
</form>
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Code: Select all

<form method="post" action="location.php"> 
What is your location? And remember, this is for posterity's sake, so please be honest.
<input type="text" name="location" /> 
</form>
Post Reply