Add a Security Question to the Join Form

Nathan Paton edited this page Apr 21, 2017 · 2 revisions

Sometimes Dolphin’s anti-spam tools and reCAPTCHA aren’t enough to keep all the spammers out. The bad bots could be too new for blacklists, and may be using a human service to solve the CAPTCHA. Where these two solutions fail, a simple question may be the answer.

The goal of a security question is to offer a simple problem any human can solve, but will still trip up a bot that’s not able to account for it. This means legitimate users can still join the site easily, while bots are left stumped. This tutorial will show how to add a simple math question to the join form.

From the Admin Panel => Builders => Profile Fields, drag up a NEW_ITEM field to somewhere on the join form. Somewhere at or towards the end of the form is recommended.

Next, click on the field to edit it. Fill in under the General tab:

  • SystemName: SecurityQuestion
  • Caption: What is 9 - 5 ?
  • Description: Prove you’re not a bot by answering this question.
  • Type: Text

Next, switch to the Advanced tab and fill in:

  • Mandatory: Checked
  • Minimum Value: 1
  • Maximum Value: 9
  • Check: return strtolower($arg0) == '4';

For a different answer, change the '4' in the Check field.

Next, switch to the Messages tab and fill in some error messages. Once done, save the field. You’re all set.

It’s recommended to test the join form to make sure there are no issues. In case it doesn’t work, check the Check code and make sure the answer is correct and there are no stray characters.


You can also ask questions that require a word for an answer. For example:

  • Caption: What color is the sky?
  • Check: return strtolower($arg0) == 'Blue';


  • Caption: Who’s the best T20 cricketer?
  • Check: return strtolower($arg0) == 'AB de Villiers';
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.