Adding Bad Word Filter
-
I’d like to parse the form input against an array of “bad words” so if they are in the submitted form, it errors and does not send. How and where in your code can I make these changes? I was thinking about adding something like this:
$badStrings = array("word1","word2","etc.");
`foreach($_POST as $k => $v){
foreach($badStrings as $v2){
if(strpos($v, $v2) !== false){
header(“HTTP/1.0 403 Forbidden”);
die(“Forbidden – You have attempted to submit false or corrupt information”);
exit;
}
}
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding Bad Word Filter’ is closed to new replies.