There are also GEO IP modules you can get for both the web servers and various programming / scripting languages.
Of course in some cases it might be easier to use a clientside bit of Javascript to handle things - it'll depend on what you're trying to do.
Years ago I used to use a rather funky tool to automatically convert UK prices in pounds to Euro - it was all JavaScript based