We all know the trouble with web spamming from poker-, game-, roulette-, discount sites and so on.
At my site learn-php i put the following code at the top of index.php of the core drupal
code:
$server = getenv("HTTP_REFERER");
$ip = getenv ("REMOTE_ADDR");
if (preg_match("/cash/i", "$server")or preg_match("/loans/i", "$server")or
preg_match("/buy/i", "$server")or preg_match("/credit/i", "$server")or
preg_match("/discount/i", "$server")or preg_match("/randppro/i", "$server")
or preg_match("/allkinds/i", "$server") or preg_match("/texas/i", "$server")
or preg_match("/roulette/i", "$server") or preg_match("/black/i", "$server")
or preg_match("/yunza/i", "$server")or preg_match("/hawai/i", "$server") or preg_match("/doctor/i",
"$server") or preg_match("/low/i", "$server") or preg_match("/epraha/i", "$server") or
preg_match("/poker/i", "$server")or preg_match("/casino/i", "$server")or preg_match("/gambling/i",
"$server")or preg_match("/game/i", "$server"))
{
header("Location: " . $server); // send them back
exit;
}
Of course it's a hack. But it works well on my site. As a result i get a far more realistic statistic.
I could imagine that the redirect to the "spam server" header("Location: " . $server)is a possible way to beat them with there own weapons. If we all do it this was.