Did you see Getting Visitor's Country with PHP using Geo IP