Make a plaintext file, on bad word on each line.
In your code, when you look for anughty words:
$bad_words_array=file("your_textfile_here");
then fetch a word to compare to the badword list, and then
if (in_array($word,$bad_words_array))
{
print "naughty word used\n";
};
in_array() is a php4-only function, but trivial to write in php3 code.