Preventing spam on messageboard
The ‘net is full of spam nowdays. Spam reaches email as well as forums, guestbooks, messageboards and blogs. Practically everywhere where it is possible to submit text there’s spam. Even youtube and metacafe have spam, even though they probably have thought about the spam bit more than we have. However, we have solved the spam problem on our domain.
Solution to messageboard spam:
<script type=”text/javascript”>
function validateForm() {
document.mainboard.validate.value = 1;
}
</script><form name=”mainboard” action=”mainboardpost.php” method=”POST” onSubmit=”validateForm()”>
…
<input name=”validate” type=”hidden” value=0 />
</form>
The idea is that stupid spambots don’t know JavaScript. Thus, when spambots find the messageboard, fill out the input fields and submit the form for mainboardpost.php to handle, they don’t realize that they should change the hidden “validate” value to “1″. All real users with real browsers do this automatically when they click “Post” button.
Today there have been 15 unsuccessful attempts to post something on the board. Most likely it’s been spam.
