Get location of User

How to get geolocation of a user i.e the "city" name for user and show to him ?

I found a java script HTML5 version but that is not accurate …

The most accurate way, is maxmind’s geoip service: http://www.maxmind.com/app/ip-location

but this requires too much work, however, a simpler solution is http://www.ipinfodb.com/ip_location_api.php