2 - Indigestion for Spam Bots
How about doing the complete opposite of last month's article? This time we generate (random) email addresses
every time a page is loaded specifically for the spam bots in order to fill up their databases with rubbish addresses
- rendering their mailing lists worthless for reselling. Here's an example list...
Alice
howard
Judith
Judith
gary
howard
elspeth
Ian
Dave
Judith
Dave
Dave
Charlie
gary
Judith
Alice
francis
gary
Bob
Alice
And here's the php code that generated it. Feel free to incorporate it into your site changing the arrays of names, companies and TLDs (top level domains).
$EmailCount = 20 ;
$AName = array ('Alice','Bob','Charlie','Dave','elspeth', ->
'francis','gary','howard','Ian','Judith') ;
$ACompany = array ('technology','photo','sales','bedding','intercom','widget', ->
'flower','board','fish','copy') ;
$ATLD = array ('net','eu','org','biz','com','co.fr','co.de', ->
'gov.uk','co.jp','ng') ;
$Extras = "1234567890abcdefghijklmnopqrstuvwxyz" ;
for ($i=0; $i<$EmailCount; $i++ )
{
$Name = $AName[rand(0,9)] ;
$Company = $ACompany[rand(0,9)] ;
$ExtraLength = rand(5,7) ;
for ($c=0 ; $c<$ExtraLength ; $c++)
$Company .= substr($Extras,rand(0,35),1) ;
$TLD = $ATLD[rand(0,9)] ;
echo '<a href="mailto:'.$Name.'@'.$Company.'.'.$TLD. ->
'">'.$Name.'</a> '."\n" ;
}
$AName = array ('Alice','Bob','Charlie','Dave','elspeth', ->
'francis','gary','howard','Ian','Judith') ;
$ACompany = array ('technology','photo','sales','bedding','intercom','widget', ->
'flower','board','fish','copy') ;
$ATLD = array ('net','eu','org','biz','com','co.fr','co.de', ->
'gov.uk','co.jp','ng') ;
$Extras = "1234567890abcdefghijklmnopqrstuvwxyz" ;
for ($i=0; $i<$EmailCount; $i++ )
{
$Name = $AName[rand(0,9)] ;
$Company = $ACompany[rand(0,9)] ;
$ExtraLength = rand(5,7) ;
for ($c=0 ; $c<$ExtraLength ; $c++)
$Company .= substr($Extras,rand(0,35),1) ;
$TLD = $ATLD[rand(0,9)] ;
echo '<a href="mailto:'.$Name.'@'.$Company.'.'.$TLD. ->
'">'.$Name.'</a> '."\n" ;
}
Note: -> at the end of a line indicates that the code is continued on the following line.