Does anyone know how to set up a text ban? For instance, if he always types the word "apple" in his submissions, how can I tell Perl not to allow a submission with the word "apple" in it to post? Any help at all would be appreciated. :-)
if($submission!~ /apple/i)
{
...do submit...
}
else
{
...create an error or do nothing...
}
(which means if submission does not contain the word 'apple', submit it - that part needs unusual characters to be prefixed with a '\', so a web address would be 'www\.wherever\.com' - the full stops have been prefixed, but a-z and 0-9 should not be)
Be sure to read Marcia`s WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com] post.
Once you have gathered the submitted text and put it into some variable use regular expressions to check for the word like so:
if($text =~ m [perldoc.com]!\bapple\b!) {
print "Apple not allowed\n";
} else {
print "Welcome!"
}
Just adjust the regular expression to whatever it needs to match. If you need some help with regular expressions this is a nice regular expression tutorial [etext.lib.virginia.edu].
HTH Andreas
<added>I was too slow</added>