You are here

function _honeypot_honeypot_validate in Honeypot 6

Same name and namespace in other branches
  1. 8 honeypot.module \_honeypot_honeypot_validate()
  2. 7 honeypot.module \_honeypot_honeypot_validate()
  3. 2.0.x honeypot.module \_honeypot_honeypot_validate()

Validate honeypot field.

1 string reference to '_honeypot_honeypot_validate'
honeypot_add_form_protection in ./honeypot.module
Form builder function to add different types of protection to forms.

File

./honeypot.module, line 197
Honeypot module, for deterring spam bots from completing Drupal forms.

Code

function _honeypot_honeypot_validate($element, &$form_state) {

  // Get the honeypot field value.
  $honeypot_value = $element['#value'];

  // Make sure it's empty.
  if (!empty($honeypot_value)) {
    _honeypot_log($form_state['values']['form_id'], 'honeypot');
    form_set_error('', t('There was a problem with your form submission. Please refresh the page and try again.'));
  }
}