Stop spam bots in phpbb (phpbb3)
Posted by admin, under CMSHere I will show you one easy, but effective, way to deal with spam bots, that are taking over your phpbb3 forum. Ever since I am using this method, I had zero spam bot registrations.
As I said, we are talking about phpbb3 and to be more exact version 3.0.3, but probably it will work on others too. The theme that I am using is prosilver, but you can use different one. In that case there will be some different things you must do. And here is what you must do.
Download via ftp program the file ucp_register.php, located in the folder includes/ucp/. Before editng it, you can back it up, just in case. Open it and before this line:
if ($agreed)
put this line:
$stopbots = ($_POST['stopbots']==8) ? true : false;
Then instead of this line:
if (!check_form_key('ucp_register'))
put this line:
if (!check_form_key('ucp_register') || !$stopbots)
Save and upload the new file instead of the old one.
Now you need to edit the file ucp_register.html, which is located in styles/prosilver/template/. If you are using another theme, then it will be in different folder. Open the file and after this code:
<dl>
<dt><label for="password_confirm">{L_CONFIRM_PASSWORD}:</label></dt>
<dd><input type="password" tabindex="5" name="password_confirm" size="25" value="{PASSWORD_CONFIRM}" title="{L_CONFIRM_PASSWORD}" /></dd>
</dl>
put this code:
<dl>
<dt><label for="stopbots">Which is the number between 7 and 9?</label></dt>
<dd><input name="stopbots" id="stopbots" type="text" size="25" /></dd>
</dl>
Or in other words, put this code (ot similar code) in the place you want a new field to apear in the registration form. Save this file and upload it.
Basically the idea is to add an extra field, with a question that only people can answer. There is that kind of field already but many bots knowing about it, are prepared and pass through it. Our field is something they do not expect and do not know about.
You can change the question Which is the number between 7 and 9?, but if you do that, you must also change the answer, which is the number 8 in this line:
$stopbots = ($_POST['stopbots']==8) ? true : false;
If a wrong answer is written by user or spam bots, they get a message that the form is invalid and to try again.


No more spam…. Thank you so much for this clever trick was worked fine. I was looking around all over for something like this but only your site give me something that works.
Glad I could help
Post a Comment