Jump to content

Show content based on the visitor's physical location.


jmbinfo

Recommended Posts

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!

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.