PHP Classes


Recommend this page to a friend!

      Form Spam Bot Blocker  >  All threads  >  Usage  >  (Un) Subscribe thread alerts  
Summary:Newbie needs help on implementing this class
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
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:

$blocker=new formSpamBotBlocker();

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

$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!)
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!


  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

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.