A good way to stop spammers on a phpBB3 message board

This is the place for any problems or issues with the website in general or the new forums in particular.
Post Reply
Mopar93
Posts: 28
Joined: Thu Feb 12, 2009 9:36 pm

A good way to stop spammers on a phpBB3 message board

Post by Mopar93 »

I see mentions of spam on this board. It's a real problem and if you'd like to see a solution to 95% of it, keep reading.

Since this is a phpbb board, this will stop almost all of the spammers who attempt to register. First, create a new file in the main directory of the forum and call it "stopspammer.html". Enter the following text as the content of this file:

Code: Select all

<html>
<head>
<title>Spammer detected</title>
</head>
<body>
<h1>IP Detected As Spam Source</h1>
We are sorry, but you are not allowed to register at this
<br>message board as long as your IP address is listed
<br>at stopforumspam.com.
<p>
Once your IP address is removed, you will be allowed.
</body>
</html>
Next, find the file called "ucp.php" in the main directory. You will be adding a short amount of code in this file. Load it into a text editor and at the very first part, you'll find the following:

Code: Select all

<?php
/**
*
* @package ucp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
Just after this, add the following code:

Code: Select all

$req_uri = $_SERVER['REQUEST_URI'];
$reg_pattern = '/mode=register/';
if (preg_match($reg_pattern, $req_uri)) {
$addr = $_SERVER['REMOTE_ADDR'];
$response = file_get_contents('http://www.stopforumspam.com/api?ip='.$addr);
$pattern = '/<appears>yes<\/appears>/';
if (preg_match($pattern, $response)) {
require_once( './stopspammer.html' );
exit();
}
}
Now, save the newly edited file. You are all done.

What will happen now, is whenever someone tries to access the registration page, their IP address will be looked up at "stopforumspam.com". If the IP address is listed there as being a spam source, instead of being able to access the registration page, the "stopspammer.html" page will be sent instead.

Do the above and there will be far fewer spammers registering on this board.

-Maurice
lucy123
Posts: 3
Joined: Sun Jan 01, 2012 8:19 am

Re: A good way to stop spammers on a phpBB3 message board

Post by lucy123 »

um...ok. this would keep out maybe 5% of spammer. spammers keep getting new ips. blocking by ip is not a good solution.
"If you are afraid of failure, then you will fail" - by me
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: A good way to stop spammers on a phpBB3 message board

Post by PacoLM »

massagegirl wrote:oh,it's very good
This is really funny, a spammer posting in an anti-spam post, weird...

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: A good way to stop spammers on a phpBB3 message board

Post by mastertheknife »

PacoLM wrote:
massagegirl wrote:oh,it's very good
This is really funny, a spammer posting in an anti-spam post, weird...
hehe :D
Kfir Itzhak.
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: A good way to stop spammers on a phpBB3 message board

Post by bb99 »

I'm sure you read the original "Sensual tantric massage escort for you"
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: A good way to stop spammers on a phpBB3 message board

Post by PacoLM »

bb99 wrote:I'm sure you read the original "Sensual tantric massage escort for you"
Yes, indeed!

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Re: A good way to stop spammers on a phpBB3 message board

Post by cordel »

Rather than commenting about spam it better to just use the forum tool to report it and not comment. This way we don't have to clutter the forum with unnecessary comments that we have to debate later weather to remove.
It always leaves a funny feeling in my stomach when I decide to delete a good standing users post just because it's talking about spam, unless it has something useful then I have to leave it. :idea:
Post Reply