an easy solution would be something like this:
<?php if (!strpos($_SERVER['HTTP_REFERER'], 'digg.com')) { echo 'ADS CODE'; } ?>
but sometimes users that come from digg take a look at the rest of your site and keep not clicking on your ads so the code above wouldn't be useful and we would have to make something like this:
At the beggining of your code put this:
<?php if (strpos($_SERVER['HTTP_REFERER'], 'digg.com')) { $expire = 24 * 60 * 60; //One day setcookie('digg_user', true, $expire); } ?>
and where your ads are put this:
<?php if (!(isset($_COOKIE['digg_user']) && $_COOKIE['digg_user'] == true)) { echo 'ADS CODE'; } ?>
Edited by Joablen, 16 September 2006 - 11:02 AM.