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

Gale-force winds
"The true (golf) pilgrim wanders off to the outlying, the more humble and obscure courses. For it is on
Secret powers
The front nine was quite a display of supernaturally and (almost) perfectly consistent golfing gusto: Par, par, par, par,
No more winter greens
The cool, windy and grayish afternoon calls me onward. It's drizzling on my windshield but I do not care.
Champion of Scotland
I nearly cried my eyes out when I discovered that young Tommy Morris dies in the prime of his
Sticky keyboard
Up until yesterday the Del-, Ins- and Home- keys on the upper right-hand corner were sticking alot, and it's