Page 1 of 1

Ban Words From Entering into Database

Posted: Wed Apr 15, 2009 6:22 am
by tomclancy
Hey guys
The scenario is that in my website "Searchfiles.Us" there are many PORN searches being made.and these searchs get recorded into the history table and gets shown up on the frontpage.Which is very unethical.So i want a solution that if i kept a file with all the banned words list on the root directory and a code...so that they dont get entered into the database.Please help me with that coding.

Thank You
www.searchfiles.us

Re: Ban Words From Entering into Database

Posted: Wed Apr 15, 2009 9:52 am
by pickle
I don't think I'd call it unethical - plastering user's personal information along with the porn searches would be.

Anyway, build an array of your ban words, iterate through it & use strpos() to check if the banned word is found. If it is, don't do anything else.

I have a feeling there's a better way to do this, but I can't think of it right now.