I'm looking for a (hopefully free) script that will display a visitor's location/city depending on their IP. Could someone help me out?
quoting Nullbyte user over here : <?php $ip = $_SERVER['REMOTE_ADDR']; $file = file_get_contents("http://www.melissadata.com/lookups/iplocation.asp?ipaddress=" . $ip); preg_match('^<tr><td align="right">Country</td><td><b>([A-Z]+)</b></td></tr>^',$file , $country); $country = $country[1]; print $country; ?>