you are getting inappropriate results because maybe you are using a localhost server, try a hosting server , i got the same problem 3 months ago it worked fine when i tested on a hosting server.
solved How to get user-ip, location, country name, currency and time in PHP [duplicate]