Question : Using IP to detect location

Hi -

I was wondering is it possible for me to detect a website visitors IP address and run a script or something to detect if they are within a 5 mile radius of a given location (or a given range of geographic locations if not a 5-mile radious.

Thanks

Answer : Using IP to detect location

The only thing that you can do is get where the IP address your user is connecting from by where the IP address has been assigned.

For instance, I'm in a small town, I use a major telco for my DSL service, however the telco is small here and pipes my DSL to some DHCP pool 400 miles away.  In this instance I'd be 400 miles from where you think I actually am.

Your best bet is to so something like some of the big store websites do.  They ask you for your zipcode when you first connect then set a cookie from that.  Take a look at the code for the Staples.com website and you'll see an example of that.


Hope this helps,


Chris
Random Solutions  
 
programming4us programming4us