Page 1 of 1
Avoid Spam In Message Board
Posted: Mon Mar 11, 2013 2:22 am
by cmarangon
How can I protecrt my Message Board from spammers?
Is the 5 digits capcha sufficient?
The one in your site:
http://www.phpjunkyard.com/mboard/mboard.php
Seems not be atqacked by spammers.
How can I protect my message board?
Sincerely,
Carlos
Re: Avoid Spam In Message Board
Posted: Mon Mar 11, 2013 8:54 am
by Klemen
The mboard is indeed due to an update, but as a temporary solution you can try this trick:
1. open file "secimg.inc.php" in Notepad
2. Change this code
Code: Select all
$text_color = imagecolorallocate($im, 0, 0, 0);
to
Code: Select all
$text_color = imagecolorallocate($im, 255, 0, 0);
3. save, upload to the server and test
Re: Avoid Spam In Message Board
Posted: Tue Mar 12, 2013 1:49 am
by cmarangon
Sure, but what this will do?
Change the capcha color to red?
Re: Avoid Spam In Message Board
Posted: Tue Mar 12, 2013 8:01 am
by Klemen
Exactly - I know that sounds too simple, but it seems to do the trick for now, because the spam bots have learned to read black text on white background.
Re: Avoid Spam In Message Board
Posted: Thu Mar 14, 2013 2:26 am
by cmarangon
And if we can make it a random color?
$RGB1 = rand (1,255);
$text_color = imagecolorallocate($im, $RGB1, 0, 0);
$RGB1 = rand (1,255);
will generate a random number between 1 and 255, this exlcude black, because it will exclude "0" from the random variable. It will return a red color or other similar to it.
Maybe this other, can generate a color RGB for captcha:
$RGB1 = rand (1,255);
$RGB3 = rand (1,255);
$RGB3 = rand (1,255);
$text_color = imagecolorallocate($im, $RGB1, $RGB2, $RGB3);
What do you think about?
Re: Avoid Spam In Message Board
Posted: Thu Mar 14, 2013 12:34 pm
by Klemen
Sure, but you may want to limit the upper value to say 125 instead of 255 or you might get very light text on white background ( = hard to read).