Would using "eregi" be the right way to do this? I am using this code to stop spammers from sending emails to me through a comment form on my site. Here's what I have: if (eregi('cialis', $tf_message)) { echo "<p><strong>Go get a real job and spam someone else!</strong></p>\n"; $send = 0; } Code (markup): So far, with the code above, if the word "cialis" is anywhere in the message, it will not let them submit the form. How do I enter multiple values to trigger the form not to send? For example, if the message contains "cialis", "viagra" or "porn", the message should not be send. Even better, I would like to create a text file with all the triggers. I would like the code to check the values contained in file.txt, and if any of those values are found, the form will not send. Any ideas at all would be appreciated!! Thanks, John
$blacklist = 'file.txt'; if (preg_match('/(' . implode('|', array_map('trim', file($blacklist))) . ')/i', $tf_message)) { echo "<p><strong>Go get a real job and spam someone else!</strong></p>\n"; $send = 0; } PHP: Put each word in a new line.