Its a simple GEO IP which is intended to pull the City name from the database according to IP but if it cannot determine the City name, it should show just "Your City". GEO IP module is enabled but this code isn't working.
Can someone please show me what I'm doing wrong here?
PHP Code:
<?php
$geo=geoip_record_by_name ($_SERVER['REMOTE_ADDR']);
echo $geo['city'];
if ($geo == "") {
$geo['city'] = "Your City";
?>