Hi Pete,
I've had an automated system lock on to my "Contact Me" form sending lists of 
porn links every 30 mins. I altered the name, but they just followed it. To 
anyone else thinking of putting a Contact me link on, don't use that name, they 
just google for it.

I have a common routine that check all inputs (for the things mentioned 
previously), but just use this for the message text.
$raw is the incoming message text.

<?php
$spamwords = array(
'<a.*a>', 'url.*url',
'cashbin.com', 'goodwarez.com', 'pdaearth.com',
'adipex', 'benadryl', 'diazepam',
'teen sex', 'shemale', 'sex toy',
);

$spam = 'no';
foreach ($spamwords as $item)
{
  if (preg_match("/$item/i", $raw)) $spam = 'yes';
}

if ($spam == 'yes')
{
  $logfile = $_SERVER['DOCUMENT_ROOT'] . '/spamlog';
  if (filesize($logfile) >= 50000) unlink($logfile);

  if (isset($_SERVER['HTTP_REFERER'])) $ref = $_SERVER['HTTP_REFERER'];
  else $ref = 'None';
  if (isset($_SERVER['REMOTE_ADDR'])) $ip = $_SERVER['REMOTE_ADDR'];
  else $ip = 'None';
  
  $date = date('D, d M Y H:i:s');
  $savedata = "[$date] [Ref: $ref] [IP: $ip] Msg: $raw\r\n";
  error_log($savedata, 3, $logfile);

  echo "<blockquote style='color:#e00'>Sorry, but your message was rejected by 
the spam filter!<br />To continue, please go back and substitute any words you 
think may be in that category.<br />Thank you, webmaster.</blockquote>";
  exit;
}
?>

This has totally stopped all my spam.
The '<a.*a>', 'url.*url', gets most of it, the rest of the array is just in 
case (only showed a few words here).

As you can see, I record any rejected messages, so I could see if it was 
locking genuine posts out.
The log deletes itself when it gets to large.

The rejected message they get is lightweight to keep bandwidth usage low. I 
deliberately didn't give a link to return.

You could use something similar to suit your needs.

As someone said earlier, you wouldn't think it was worth their while targeting 
one person, but they do seem to.
Regards, Bob Exton.




Community email addresses:
  Post message: [EMAIL PROTECTED]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-list/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to