1. Geo-targeting Script : The Ultimate Guide Using Lambda Geo-target and others to determine the physical location of your visitors
2.
3.
4. How to Find the Nearest Major City Using Geo-targeting <?php require(“geoip.php”); echo geoip_closest_format(“%city, %region”, 2000000) ; ?> Will output: Los Angeles, California If you lived in a small town near Los Angeles, California. geoip_closest_format() returns the closest city of 2,000,000 people or more, depending on what you specify. Using Lambda Geo-target
5. How to Forward a User to a Different URL Based on Location (pt 2) <?php geoip_forward_region(“California”, “cali.html”); geoip_forward_country(“Georgia”, “ga.html”); geoip_forward_contient(“NA”, “na.html”); geoip_forward(“catchall.html”); ?> This will forward California users first, then Georgia users, then will forward all other users in North America. Finally, all users who aren’t in the above groups will be forwarded to catchall.html. Using Lambda Geo-target
6. How to display a Map with the User’s Location <script type="text/javascript"> if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById(" map_container ")); map.setCenter(new GLatLng( <?php echo geoip_latitude . “, “ . geoip_longitude(); ?> ), 6 ); map.setUIToDefault(); var point = new GLatLng( <?php echo geoip_latitude . “, “ . geoip_longitude(); ?> ); map.addOverlay(new GMarker(point)); } </script> Using Lambda Geo-target and Google Maps <script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key= api_key " type="text/javascript"></script> Put this somewhere after your <body> tag: Put this in between your <head> and </head> tags: Replace api_key with your Google Maps API key. Replace map_container with the id of the <div> where you want the map to go. Replace the number 6 with the zoom level you want.
7. Displaying the User’s location on the Maps The end result will look something like this. There are all sorts of neat things you can do with Google maps and the user’s location. Get creative.