View Single Post
Old 08-13-2015, 05:35 AM  
RummyBoy
Confirmed User
 
Join Date: Dec 2009
Posts: 2,157
GEO IP Code Expert Needed

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";
?>
RummyBoy is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote