homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Discussion Board.Please Help!
How to keep "PESTS" away!

10+ Year Member

Msg#: 13107 posted 4:16 pm on Jun 4, 2006 (gmt 0)

Hi All,

I have a nice discussion board on my web site.
Everyday I have to remove loads of pain in the butt posts. The comments board was created using a simple php script. How can I avoid this from happening, without setting a password to gain access. I really do not want to set a password to the board. My visitors really enjoy the freedom
of posting to the board, without using passwords.
Can anyone help? I can post the script here if you need me to.

Thanks in Advance
You Guys/Ladies are Great



WebmasterWorld Senior Member dreamcatcher us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 13107 posted 4:36 pm on Jun 4, 2006 (gmt 0)


A couple of effective solutions might be to include a Captcha image, or something less server intense like a simple sum. This is what I use on a lot of my sites.

So, firstly, generate 2 random numbers:

$one = rand(1,9);
$two = rand(11,99);

Assign these to hidden fields on your post page:

<input type="hidden" name="first" value="<?php echo $one;?>">
<input type="hidden" name="second" value="<?php echo $two;?>">

Pop a live box on the post form:

For spam prevention, add the following sum:<br>
<?php echo $one;?>+<?php echo $two;?> = <input type="text" name="sum">

Then do a check when posted:

if ($_POST['first']+$_POST['second']!=$_POST['sum'])
// error

Something simple like that should be ok. Of course if you have people actually posting then you have a problem. This should be effective enough to stop the spam software.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved