I am currently running vbulletin.com with Google adsense, but I would like to prevent certain websites from viewing my Google Adsense ads when my entire website is viewed on their domain. Some cheesehead decided to submit my site to a few traffic exchanges thinking I need their pathetic traffic without realizing that this is putting my Google Adsense account in jeapordy. I have removed the Google Adsense ads from my site and notified Google as well. But is there a special code to wrap around the Google Ads to prevent them from being displayed on this domain: http://www.a1mails.co.uk/ Any help is appreciated.
$domain = 'domainyouwantblocked.com'; If(str_replace('www.', '', $_SERVER['server_name']) == $domain) { die(); } Code (markup): Something like that. That will cut off traffic to that domain completely. You can also do... function display_adsense() { If(str_replace('www.', '', $_SERVER['server_name']) == $domain) { return FALSE; } else { return TRUE; } } Code (markup): And then do if(display_adsense()) echo "adsense code"; } Code (markup):
Ahh yah..thanks. This is good enough to get started. I will pass this code to a few die-hard coders in vb.org and vbhackers.com to get it straightened out. Thank you. You are a true savior!