Does anyone know how to change the layout of a website based on where the viewer is living? So basically, I want to write some kind of script to put on my website, so that when .. say people from New York City view it, they view it one way, whereas when people from Kansas view it, the layout changes it a bit.
A layout based on ip addresses maybe?? Any help would be awesome! thanks so muchChange a website layout based on where the viewers geographical location?Easy! (Relatively).
You need a database of all world wide IP addresses (get it free at http://www.web2coders.com. Warning: it contains over 3 millions IP addresses!)
As you receive the call from the browser, get the IP address with $_SERVER['REMOTE_ADDR'], then define your contents according to the location you get.
(The script provided also has an exemple on how to use it).Change a website layout based on where the viewers geographical location?First you need to have a in-depth knowledge about ip address, the components it is made up of and the related issues like proxy server, shared ip etc. , before you can implement such functionality. You will know that we can track the location of the user requesting/visiting your page by his ip. once you get hold of his location infos, it wont be a problem to implement your requirment. Search in google for ip tracking concepts, codes, 3rd party softwares etc.
Hope this helps.Change a website layout based on where the viewers geographical location?You don't say what scripting language your site is in, but I can give you info about PHP.
In PHP, it's quite simple to obtain a user's IP address. All you have to do is type:
$ip = $_SERVER['REMOTE_ADDR'];
and $ip will contain the user's IP address. Actually determining what country they're from will be a little more complicated. You'll actually have to get a list of all IP addresses and which countries they belong to. Fortunately, this has already been done, but you'll need to get a script like the one found at http://webscripts.softpedia.com/script/P鈥?/a> .