Server name not in referer

 | Perl | 2 Comments | 0 TrackBacks

How to distinguish comment and/or email spam from the real thing:

#!/usr/bin/perl
use strict;
use CGI qw( :standard );
my $server_name = server_name();
my $referer = referer();
my $is_spam = $referer !~ /$server_name/;

No TrackBacks

TrackBack URL: http://www.kiffingish.com/cgi-bin/mt/mt-tb.cgi/177

2 Comments

The Referer field can be changed to anything you like, so the "security" isn't there.

True, but for this case it seems to work very well. Not all spammers are as knowledgable as you.

Leave a comment

Recent Entries

A walk along the Keizersgracht
Too often one is so consumed by a jungle of intertwined thoughts that the beauty of the nearby surroundings ... »
Popularity is fickle
The popularity of a given next generation technology is very fickle, and its success or failure depends on many ... »
Where was Kiffin really buried?
Hi There seems to be some confusion on the current resting place of Kiffin Rockwell, some say that his ... »
Going to Portugal
Normally the week just before I leave for summer vacation, I spend hours on end desperately searching for some ... »
A human language
These days it is not very often that a new and exciting Perl book comes along. That's why I ... »