The following code should do what you want:
PHP Code:
# Include the geoip api files
include("geoipcity.inc");
include("geoipregionvars.php");
$gi=geoip_open("/path/to/GeoIPCity.dat",GEOIP_MEMORY_CACHE);
# Get the details for the remote address
$record = geoip_record_by_addr($gi,$_SERVER['REMOTE_ADDR']);
The following variables should be available: country_code, region, city, postcode, latitude, longitude, dma_code and area_code. So for example, to print the city, you can do:
PHP Code:
print $record->city;
You can look at the Google docs to get all the details for getting a map on your page. The part you'll be most interested in is adding the point to the map. First you'll have the center the map on the point you're interested in, so you can do:
PHP Code:
map.setCenter(new GLatLng(<?=$record->longitude;>, <?=$record->latitude;?>), 5);
The you will have to add the marker:
PHP Code:
var point = newGLatLng(<?=$record->longitude;>,<?=$record->latitude;?>), 5);
var marker = createMarker(point,"<?=$record->city;?>");
map.addOverlay(marker);
Hope this helps.
Niall.