Referrer Spam
Turing test stops spam
As a rule, spammers use special programs - bots-that automatically look for vulnerable sites and spam them with hundreds of links. There are several ways to prevent spam attacks of the kind. Here is one of them. First of all, we must protect our site from spam-bots to guarantee that it is real people that leave messages and comments.
software oem cd line business? Buy Cheap Macromedia Studio 8 for Mac adobe cs2 photo shop total training?
microsoft office 2003 oem Buy Cheap Adobe Photoshop CS4 for Mac locate software oem files
widows oem software Buy Cheap Autodesk 3ds Max 9.0 window 2000 upgrade download
quark xpress 6 crack Buy Cheap Autodesk AutoCAD 2008 “oem software bundle”
software oem italiano Buy Cheap Macromedia Dreamweaver 8 adobe photo shop element
Oem software cds oem software cheap 502. Buy Cheap Adobe Premiere 2.0 microsoft window 2000 professional oem software
cheap software downloads Buy Cheap MS Office 2000 Premium oem Microsoft Office
adobe standard encoding Buy Cheap Adobe InDesign CS2 oem office 2000 software
upgrade window 2000 to xp Buy Cheap Adobe Audition 3.0 dvd to pocket pc 1.2.4
inkjet definition oem software Buy Cheap MS Windows 2000 Server - Full Version The Logo Creator MEGA pak 3.6
financial planning software australia Buy Cheap Corel Smart Graphics Studio 1.1 Buy cheap PhotoShop CS 2,
iCorrect EditLab Pro 4.52 Buy Cheap Adobe Photoshop CS2 for Mac software oem cd line business?
adobe cs2 photo shop total training? Buy Cheap Guitar Pro 5.2 microsoft office 2003 oem
locate software oem files Buy Cheap Adobe Illustrator CS V 11.0 PC widows oem software
window 2000 upgrade download Buy Cheap Adobe InDesign CS4 quark xpress 6 crack
“oem software bundle” Buy Cheap CyberLink PowerProducer 4.0 software oem italiano
adobe photo shop element Buy Cheap Adobe FrameMaker 9.0 Oem software cds oem software cheap 502.
microsoft window 2000 professional oem software Buy Cheap Microsoft Visual Studio 2008 cheap software downloads
oem Microsoft Office Buy Cheap Adobe Premiere Elements 2.0 adobe standard encoding
oem office 2000 software Buy Cheap Adobe Illustrator CS2 upgrade window 2000 to xp
dvd to pocket pc 1.2.4 Buy Cheap Microsoft Frontpage 2003 (DEUTSCH) inkjet definition oem software
The Logo Creator MEGA pak 3.6 Buy Cheap Microsoft Office 2007 Ultimate financial planning software australia
Buy cheap PhotoShop CS 2, Buy Cheap Nero 9.2.6.0 Final iCorrect EditLab Pro 4.52
software oem cd line business? Buy Cheap Adobe Fireworks CS3 for Mac adobe cs2 photo shop total training?
microsoft office 2003 oem Buy Cheap Microsoft Office 2003 Professional (DEUTSCH) with Business Contact Manager locate software oem files
widows oem software Buy Cheap ZoneAlarm Pro 8.0.015.000.XP window 2000 upgrade download
quark xpress 6 crack Buy Cheap Adobe FrameMaker 8.0 “oem software bundle”
software oem italiano Buy Cheap Acronis True Image Home 11.0 adobe photo shop element
I recommend using Turing test for protection against spam-bots. It’s needed to install a script that will generate random numbers and show them as images. After this site visitors will enter this number in a special field for comparison. The thing is that bots can not read the text on the images.
button.php
<?php
$image = imagecreate(120, 30);
$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$darkgray = imagecolorallocate($image, 0x50, 0x50, 0x50);
srand((double)microtime()*1000000);
/*
* Print the random grey lines
*/
for ($i = 0; $i < 30; $i++) {
$x1 = rand(0,120);
$y1 = rand(0,30);
$x2 = rand(0,120);
$y2 = rand(0,30);
imageline($image, $x1, $y1, $x2, $y2 , $gray);
}
/*
* Fill array $cnum with random numbers
*/
for ($i = 0; $i < 5; $i++) {
$cnum[$i] = rand(0,9);
}
/*
* Print random dark grey numbers from $cnum
*/
for ($i = 0; $i < 5; $i++) {
$fnt = rand(3,5);
$x = $x + rand(12 , 20);
$y = rand(7 , 12);
imagestring($image, $fnt, $x, $y, $cnum[$i] , $darkgray);
}
/*
* Assemble random digits form array to single whole number
*/
$digit = \"$cnum[0]$cnum[1]$cnum[2]$cnum[3]$cnum[4]\";
/*
* Start new session
*/
session_start();
$_SESSION['digit'] = $digit;
/*
* Print image header
*/
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>
button.php should be used for image source.
<img width=120 height=30 src=\"button.php\" border=\"1\">
audit.php
<?php
function audit() {
session_start();
/*
* Read the session variable
*/
$digit = $_SESSION['digit'];
/*
* Read the user entered numbers
*/
$userdigit = $_POST['userdigit'];
/*
* Destroy the session
*/
session_destroy();
/*
* Compare the numbers
*/
if ($digit == $userdigit) {
return true;
} else {
return false;
}
}
?>
Scripts implantation
<form action=\"frm.php\" METHOD=\"POST\"> <img width=120 height=30 src=\"button.php” border=”1″> <br> <input MAXLENGTH=5 SIZE=5 name=”userdigit” type=”text” value=”\"> <br> <input type=”submit”> </form>
In action script you can use following code:
frm.php
<?php
include \"audit.php\";
if (audit()) {
echo \"Passed...\";
}
?>
The function audit() returns “true” if the number entered by the visitor coincides with the number on the image, and returns “falseâ€? in other cases.
Working sample can be found here