Geotargetting is uploading a library and adding eight lines of code to increase the amount you can charge somebody for internet traffic in order to save them the hassle of uploading a library and copy-pasting eight lines of code themselves.
I exaggerate slightly, you also need if ($country == 'whatever') { .. } for any country you want to filter. So ten lines of code.
Edit, in fact, it's been years since I read the doco, and I've had significant feature creep in my location services since which has made me over estimate the number of lines you'd need. I think you can actually do it in four.
- Code: Select All
require_once("/path/to/geoip.inc");
$country = geoip_country_code_by_addr($_SERVER['REMOTE_ADDR']);
if ($country == 'GB') {
do stuff.. }
Untested, but should do the trick.