Forum Moderators: coopster
I have devised a crude PHP script which works in a test environment. It determines the referrer page, and if it is an image search engine sets a variable which prevents the ads being displayed. If the user proceeds further into the site then ads are displayed as normal.
I'm not a PHP expert so would welcome comments before I try it live. There is also the possibility that I am reinventing the wheel. :)
The code is below.
<?php
$allowads = "yes"; // used later in the html as a test for displaying ads
$from = "";
if (isset($_SERVER['HTTP_REFERER']) ) {
$from = $_SERVER['HTTP_REFERER'];
if (stristr($from, "image") ¦¦ stristr($from, "Image")) {
$allowads = "no";
}
}
?>