PHP Classes

File: readme.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  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: New info on how to set up writing output to a mysql database
Date: 6 years ago
Size: 2,256 bytes


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

Note: Your server has to be running PHP 5, unless you change the spam blocker class code to run on PHP 4.

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.