henry0

msg:3814148 | 11:15 pm on Dec 24, 2008 (gmt 0) |
Forget about blocking users, too many proxies and dynamic IP what you need is a clear head :) and review both links and each and every links within both links Did I already confuse you? First set [webmasterworld.com] Second set [webmasterworld.com]
|
Mahabub

msg:3814197 | 6:24 am on Dec 25, 2008 (gmt 0) |
brancook, Is it not a good idea use captcha to avoiod spam? Thanks Mahabub
|
brancook

msg:3814458 | 4:30 am on Dec 26, 2008 (gmt 0) |
henry0 - yep you got me confused. Mahabub - how come?
|
penders

msg:3814554 | 2:04 pm on Dec 26, 2008 (gmt 0) |
Blocking bad words can help to keep your form submissions / forums clean, but IMO the majority of spammers posting these bad words are likely to be robots and there are better techniques to try and stop robots, rather than targeting the bad words (there are a lot of bad words!). Another thread that might be a useful read... Frustrated with Spambots Coming In through Webmail Forms [webmasterworld.com] Anyway, back to your original query of checking for the existence of any one of a list of words within a block of text. I'm not sure that this can be done within a simple IF statement unless a strpos()-like function exists that can take an array of strings/words to match (which I don't think it can)? One way to do this is to store your list of bad words in an array, then step through this array searching for each word in your $msg. As soon as you find a $bad_word then fail... $msg = 'This is my message containing a nasty word.'; $bad_words = array('bad','nasty','awful','rude','words'); $found_bad_word = false; foreach ($bad_words as $word) { if (strpos($msg,$word) !== false) { $found_bad_word = true; break; } } if ($found_bad_word) { echo '<p>Found a bad word: "'.$word.'"</p>'; } else { echo '<p>No bad words found :)</p>'; } |
| As mentioned, I wouldn't use this bad words list to block a user (unless perhaps they persistently offend), but to perhaps warn that they have entered unsavoury content that should be corrected.
|
henry0

msg:3814556 | 2:14 pm on Dec 26, 2008 (gmt 0) |
As per penders, bad words should only be used to clean txt Banning members does not work perfectly due to proxy and dynamic IP Captcha is only a better level of defense; be advised that some bots are going through it as butter penders and I supplied a few links you should invest time to implement such a system one of the bots expert on board is alex, review, learn from the posts and seek help when needed.
|
brancook

msg:3815095 | 2:01 pm on Dec 28, 2008 (gmt 0) |
Thanks for the info everyone, I'll take some time and read through those threads.
|
|