I have a form that sends an email. I have a list of words to ban, and they are manually entered in an array. Each word in the array gets a point which eventually can reject a mail send. I want to put the words into a file instead to call up because though this works, its slow to update especially across several domains. Sorry for my lack of skill. Thanks.
$badwords = array("word1", "word2", "word3");
foreach ($badwords as $word)
if (strpos(strtolower($_POST['comments']), $word) !== false
As the badwords add up, the point value increase to a limit which then rejects the send.
Excuse me, I was not clear evidently. I want to take the EXISTING array of badwords and put them in a file, in some sort of order and entry (line per line, or comma separated?). I want to call that file to be read by the existing script. So maybe it theoretically looks like : $badwords = badwords.php and so on.... Thanks
In words.php:
In your main script:
Result: