heres a totally free method that doesnt cause a huge server load either..
keep in mind because its free its not the BEST geo database out there but hey its free..
save as something.php
----------------------------------------------
Code:
<html>
<head>
</head>
<body>
Hi, Im Brooke my hometown is
<?php
// ip to html bt stb
$addr = getenv("REMOTE_ADDR");
$tb = "http://api.hostip.info/get_html.php?ip=$addr&position=true";
$ntml = file_get_contents($tb);
$trip = explode('Latitude:',$ntml);
$ctcn = $trip[0];
$trip = explode('City: ',$ctcn);
$ctcn = trim($trip[1]);
echo $ctcn;
?>
</body>
</html>
-------------------------------------------
Heres an example
http://ytmnd.webspacemania.com/freegeo/