jmbinfo Posted May 21, 2009 Share Posted May 21, 2009 hello - I am trying to find a solution where we can show content based on the user's physical location. For example, if we had a gardening website and someone visited the site from California we should show them plants that reside in California. I am not a PHP guy but instead I am on a fact finding mission that I will forward on to our dev team. Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/159109-show-content-based-on-the-visitors-physical-location/ Share on other sites More sharing options...
MadTechie Posted May 21, 2009 Share Posted May 21, 2009 Okay, to find where a visitor is, its probably best use an IP lookup, eash ISP buy a range of IP address and register them under their name, this includes country, town and city. to get the visitors IP address just use $_SERVER['REMOTE_HOST'] to find the details about that IP, you can use ip2location this is a paid for service, so their will be a cost, their are some free ones (google for IP to city database, or something like that) as a note, you may want to allow the uses to also select their location as a manual override, as the lookup will not always be 100% correct Quote Link to comment https://forums.phpfreaks.com/topic/159109-show-content-based-on-the-visitors-physical-location/#findComment-839269 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.