Login   Register  
PHP Classes
elePHPant
Icontem

Usage

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Form Spam Bot Blocker  >  All threads  >  Usage  >  (Un) Subscribe thread alerts  
Subject:Usage
Summary:Newbie needs help on implementing this class
Messages:2
Author:Peter Wong
Date:2007-05-14 04:21:05
Update:2008-05-26 08:04:11
 

  1. Usage   Reply   Report abuse  
Picture of Peter Wong
Peter Wong
2007-05-14 04:21:05
Hi,
I am a newbie so please be gentle!

I have been charged with modifying some php pages and include controls that will reduce the number of spam.

I have a form page (contact.php)to which I added the following lines:

require_once("fsbb.php");
$blocker=new formSpamBotBlocker();
$hiddenTags=$blocker->makeTags();

contact.php in turn calls ContactFormProcessor.php which validates the entries on the form and submits the email. I've added the code in:

require_once("fsbb.php");
$blocker=new formSpamBotBlocker();
$blocker->setTimeWindow(2,30); // set the min and max time in seconds for a form to be submitted
$blocker->setTrap(true,"mail"); // called here, because it has been called on the form page as well (same trap name!)
$param=false;
$nospam=false;
if ($_POST) $param=$_POST;
elseif ($_GET) $param=$_GET;
if (!$param) die("Error");

Am I on the right track? I'm very very new to PHP so no flames please!

PW

  2. Re: Usage   Reply   Report abuse  
Picture of David K. Lynn
David K. Lynn
2008-05-26 08:04:11 - In reply to message 1 from Peter Wong
PW,

You appear to be on the right track but, as I just mentioned in another thread, this is a precursor to validation checks you MUST perform on the input data before forwarding or accessing a database.

Regards,

DK