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>
Code: Select all
<?php
/**
*
* @package ucp
* @version $Id$
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
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();
}
}
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