I'm looking to deliver ads based on whether the user's country is: 1. USA 2. UK 3. Anything else I wondered if it's possible to use a PHP script to deliver one of 3 includes files based on the visitor's IP? Many thanks for any replies.
Not yet - starting from scratch on this. ADDED: ust been suggested I look at something like phpadsnew, which apparently has this already set up. Will play7 around with it.
Here is a quick guide: 1. Visit http://ip-to-country.webhosting.info/node/view/6 to download the IP to country db 2. Visit http://ip-to-country.webhosting.info/forum/5 to know how you can convert and use the database
Well once you know the country (via geotargetting database), the include part is cake. For example maybe you have the user's country set as a variable of $country thanks to geotargetting. You can have an include within logic, so it could work like so: switch ($country) { case 'USA': include ('usa_file.php'); break; case 'UK': include ('uk_file.php'); break; default: include ('all_others_file.php'); } PHP:
Just in case you're interested I am looking for testers for a new GeoTargeting ad management script I created, as shown in this post... http://forums.digitalpoint.com/showthread.php?t=75962 ...It's not meant to compete with PHPAdsNew, but instead be much simpler and provide some basic features like GeoTargeting. -Matt