Avoid Spam In Message Board

Is message board greying out your hair (at least what's left of it)? Let us help you here
Locked
cmarangon
Posts: 5
Joined: Thu Dec 07, 2006 2:36 pm

Avoid Spam In Message Board

Post 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
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Avoid Spam In Message Board

Post 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
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
cmarangon
Posts: 5
Joined: Thu Dec 07, 2006 2:36 pm

Re: Avoid Spam In Message Board

Post by cmarangon »

Sure, but what this will do?
Change the capcha color to red?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Avoid Spam In Message Board

Post 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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
cmarangon
Posts: 5
Joined: Thu Dec 07, 2006 2:36 pm

Re: Avoid Spam In Message Board

Post 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?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Avoid Spam In Message Board

Post 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).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Locked