PHP Classes

File: readme.txt

Recommend this page to a friend!
  Classes of Alec Scaresbrook  >  Spam blocker  >  readme.txt  >  Download  
File: readme.txt
Role: Documentation
Content type: text/plain
Description: Readme file for spam blocker
Class: Spam blocker
Check visitor IP address in Project Honey Pot RBL
Author: By
Last change: An update to 2015
Date: 6 years ago
Size: 2,344 bytes


Class file image Download
Copyright (c) 2015, Alec Scaresbrook All rights reserved.
To use spam blocker:

Note: Your server has to be running PHP 5.
Writing the visitor data to the database is about 5 times faster than writing to files.
The current version has been tested on PHP Version 

1 Join Project Honey Pot ( and contribute to the project. Obtain an API key for querying the Project Honey Pot database. 
Find var $apikey = 'abc'; in the spam blocker class code.
Replace 'abc' with the Project Honey Pot API key.

2. Put the spam_blocker_class.php in a folder in the root of your web files.

3. Put the following code at the beginning (above the header) of each web page to be protected. I've put it on every page.

    include( "class/spam_blocker_class.php");
Change the folder name 'class/' if required. 
Within the two double quotes of the spam_blocker_control("") code you can specify a path to the folder where the visitor files are to be written.  Example: $ip->spam_blocker_control("visitor_files/"); 

Make that folder on the development computer (if required) and the server, and make sure that write permissions are set.  If the two double quotes are left empty, then the visitor files are written in your web page root.

4. The file 'spam_blocker_connection.php' is for connecting into your mysql database. Tables are automatically created in the database you specify. By default the server connection variables are empty which means files are written by default. 

Put the 'spam_blocker_connection.php' file in the root of your web files, unless you want it in a folder, then change the path for 'include ("spam_blocker_connection.php");' in the 'spam_blocker_class.php' file code.

It is easy to forget that spam blocker is working in the background all the time, which means that a large amount of visitor data accumulates, so I've added a switch so that the writing of data can be disabled. 

Just under 'var $apikey = 'abc';' is 'var $write_data = true;'.  Change the '$write_data' value 'true' to false, to disabled the writing of data.
For more information send a message to info at phpclasses dot org.