Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners Cgi > How to detect i...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 1427 of 1478
Post > Topic >>

How to detect if a text body contains forbidden words

by bo.berglund@[EMAIL PROTECTED] (Bo Berglund) Nov 20, 2007 at 07:25 AM

I am using a modified version of the old formmail.pl script on my
website to get information requests mailed to me.
I have modified the script to NOT send email other than to two fixed
(hardcoded) addresses (myself and our sales dept). I had to do this
becvause spammers started to use my request pages as spam entry
points.

Now the spammers have advanced and are filling the fields with html
links in the hope that someone will click the links...

So I want to expand the script to block sending altogether if the body
contains forbidden words like 'href=' or 'http://'.

But I have no clue as regards PERL programming so I would like to get
some help in this.

I have a form field called 'Feedback' that is loaded with the contents
of a text box on my page. This text block is what I want to check for
the forbidden words and either modify the subject of the outgoing
email by adding something like '*** SPAM ***' to it or else not send
the email at all if forbidden words are found.

I think that the textbox contents can be retrieved by the following
function:
$CONFIG{'Feedback'}

What I would like to do is to add a new function right before the mail
send call inside the main procedure which could set an error if the
feedback contains the forbidden words.

The main procedure now looks like this:


# Check Referring URL
&check_url;

# Retrieve Date
&get_date;

# Parse Form Contents
&parse_form;

# Check Required Fields
&check_required;

# Return HTML Page or Redirect User
&return_html;

# Send E-Mail
&send_mail;

I would like to have a checking procedure right in front of
&send_mail, which will fail the script if the forbidden words are
present.

Any clues as to how to do this?

Bo Berglund
 




 9 Posts in Topic:
How to detect if a text body contains forbidden words
bo.berglund@[EMAIL PROTEC  2007-11-20 07:25:11 
Re: How to detect if a text body contains forbidden words
rcook@[EMAIL PROTECTED]   2007-11-20 19:58:50 
Re: How to detect if a text body contains forbidden words
lhernsen1015@[EMAIL PROTE  2007-11-20 08:25:15 
Re: How to detect if a text body contains forbidden words
bo.berglund@[EMAIL PROTEC  2007-11-20 18:39:25 
Re: How to detect if a text body contains forbidden words
bo.berglund@[EMAIL PROTEC  2007-11-20 19:01:08 
Re: How to detect if a text body contains forbidden words
bo.berglund@[EMAIL PROTEC  2007-11-20 22:15:33 
Re: How to detect if a text body contains forbidden words
bo.berglund@[EMAIL PROTEC  2007-11-20 18:45:10 
Re: How to detect if a text body contains forbidden words
noreply@[EMAIL PROTECTED]  2007-11-20 20:03:38 
Re: How to detect if a text body contains forbidden words
bo.berglund@[EMAIL PROTEC  2007-11-20 20:42:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 18:55:36 CDT 2008.