Possible Duplicate:
IP to Country?
I would like to know how I can detect the language and country of a visitor to my website. It is my understanding that it is best to get this information from the IP but I don't know how to do that. Is this the method that large e-commerce sites use? If there is a database of location based on IP will it remain valid for a while or does that sort of information change rapidly?