CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Using Hidden Fields to Filter SPAM in Stand-Alone Profiles
Pages: [1]

Author Topic: Using Hidden Fields to Filter SPAM in Stand-Alone Profiles  (Read 1100 times)

tak

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 3.4.5.
  • CMS version: Joomla
  • MySQL version: 5.1.58
  • PHP version: 5.2.17
Using Hidden Fields to Filter SPAM in Stand-Alone Profiles
November 10, 2011, 07:55:49 pm
Hi All,


Sorry if I'm a bit of newbie when it comes to working with CiviCRM. I'm trying to figure out how to filter out SPAM that we're receiving through a stand-alone profile form that we're using for our newsletter sign-up.

I was interested in Piotr's suggestion here in this thread: http://forum.civicrm.org/index.php?topic=12037.0

Where he suggests using a hidden field as a kind of 'honeypot' to trick SPAM robots. While the technique seems simple enough, I'm not sure if I'm skillful enough as a developer to sort out with CiviCRM's hooks.

I think "hook_civicrm_validate" could be used to check to see if the hidden field has a value and here: http://forum.civicrm.org/index.php?topic=17020.0, it looks like there is an easy way to add hidden-fields to profiles.

However, I don't understand how to find the value for $formName. It was suggested in another thread to put a printstatement in the hook to find the form name, but I'm not quite sure how that works. Any help, advice or examples would be greatly appreciated.

Thanks,

Tak



Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Using Hidden Fields to Filter SPAM in Stand-Alone Profiles
November 17, 2011, 01:55:08 am
Quote
However, I don't understand how to find the value for $formName. It was suggested in another thread to put a printstatement in the hook to find the form name, but I'm not quite sure how that works. Any help, advice or examples would be greatly appreciated.

as mentioned in http://forum.civicrm.org/index.php/topic,17020.0.html

$formName = class name of the form that is used to render the form. So in case of profile it is "CRM_Profile_Form_Edit"

I would recommend reading developer book: http://en.flossmanuals.net/civicrm-developer-guide/

You should also enable recaptcha for your profile to reduce spam.

HTh

Kurund
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Using Hidden Fields to Filter SPAM in Stand-Alone Profiles

This forum was archived on 2017-11-26.