Displaying their IP number is easy, displaying the country name they are in is a very different matter.
To do the latter you need to have a geoip database (with updates, as it will change often) and then query the database with the IP.
This will likely cost you significant time and money.
Alternately, you can use a third party service.
For example:
http://geobutton.com/FreeServices.htm
Their "GeoPhrase" service is the closest to what you describe.