As a followup, I've been writing a section for the
Guestbook script to check for curse words... but it
doesn't work.

Can someone please check my perl?
---- Begin Code -----
# Check that the comments do NOT contain "curse" words
open (FILE,"$cursewordlist") || die "Can't Open $cursewordlist: $!\n";
@cursewords=<FILE>;
close(FILE);
foreach $x (@cursewords)
{
        if ($FORM{'comments'} =~ /$x/i)
        {
                &no_comments;
        }
}
----- End Code ------

I've created the file defined by $cursewordlist, set it's
permissions to 755, and put it in the appropriate location.
Each word is on it's own, individual line such as

Casino
SPAM
Viagra
etc.

But NOTHING triggers the conditions.
I know this has got to be something simple, but I've had
too much turkey the last few days, and I'm not seeing it.
It says that the comments are valid (even with a match),
and prints them, instead of giving a "You haven't entered
any comments" page.

I've currently got this code after the initial check for
no comments, but before I start parsing the information.

Bill Ward



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to