The part that sends the message was omitted.$Name=param('Name'); $Organization=param('Organization'); $Email=param('Email'); $Phone=param('Phone'); $Message=param('Message'); $Number=param('Spam Number'); $Spam=param('Spam'); $Robot=param('Robot'); $Result=param('Result'); if ($Name eq ""||$Organization eq ""||$Email eq ""||$Phone eq ""||$Messag +e eq "") { print "The FORM is INCOMPLETE. All Fields Marked With An * Are Require +d"; exit; } if ($Number ne "$Spam") { print "You Entered An Incorrect Anti Spam Number. Please try again."; exit; } if ($Result ne "5") { print "You Entered An Incorrect Answer. Please try again."; exit; } if ($Robot ne "1") { print "The Form Is Not Complete. Please try again."; exit }
I want establish an array that will contain prohibited words and then search the $Message. If $Message contains any of those words I want to print a response such as "Bad Words Not Permitted. Please try again." I have seen some examples of how to do all this but have not been able to get anything to work. Either the program responds to the first word in the array or nothing happens. Here's an example that I found and tried:
This works for the first word but not the second, and if neither are present the rest of the program does not work.@forbidden =("porn","sex"); foreach $forbidden (@forbidden) { if ($Message =~/$forbidden/) { print "Bad Language Not Permitted";] exit;}
Can someone suggest a solution or tell me what I'm doing wrong? Any and all help will be appreciated.Tks!
In reply to Bad Language In Contact Messages by Milti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |