Hi,
Here is little code I use to get users country.
It is not superb but it works rather fine.
$host = gethostbyaddr($REMOTE_ADDR);
$hostdot=".";
$result = strrchr($host, $hostdot);
In result you will get e.g.
.be
.de
.uk
etc...
Hope this helps you out.
If someone knows a better way of how to get the country. Send me a comment cause I means there must be a better way of doing this.