Does anyone have a code or script or any idea how to write on (I know PHP, through tutorials ) to alternet ads between YPN and Adsense based on the visitors location. Thanks to anyone who can points me in the write direction.
Script: http://www.phpadsnew.com GeoIP Database: http://www.maxmind.com/download/geoip/database/ And I think these words you meant to change, they are right not write and alternate not alternat.
i use the above geoip database and my own code like: include "path_to/geo2.php"; if ($visitor_country_code == "US") $showme = 1; else $showme = 2; .... .... .... then I call showad funtion where I want the ad to show - like show_ad($showme,x); // x = (a number representing the size of the ad); ........ ........ you have many ways to call the right ad like putting all codes in this function, calling other functions or including the right file. to include the file that has the right ad: function show_ad($showme="",$ad_size=""){ if ($showme ==1){ if ($add_size == 1) include /pathto/yahoo_header.php; else if ($add_size == 2) include /pathto/yahoo_vertical.php else if ($add_size == x) include /pathto/yahoo_x.php;//any name or size } else { // do google files } }