PHP Classes

Defensive programing

Recommend this page to a friend!

      PHP Classes blog  >  8 defensive programmi...  >  All threads  >  Defensive programing  >  (Un) Subscribe thread alerts  
Subject:Defensive programing
Summary:Additional tip
Author:Gerry Danen
Date:2007-04-25 19:37:49
Update:2007-04-26 06:17:28

  1. Defensive programing   Reply   Report abuse  
Picture of Gerry Danen Gerry Danen - 2007-04-25 19:42:38
I use Browscap [] to determine whether my forms pages are accessed by robots (using the 'crawler' entry) and display a message instead of a form. I also log those attempts to see if I mistakenly block human users.

  2. Re: Defensive programing   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2007-04-26 06:17:28 - In reply to message 1 from Gerry Danen
I am not sure if relying on browscap to determine whether an user is actually a robot, because robots usually spoof the user agent information.

Anyway, logging is also an helpful practice that can be used to detect anomalous activity.