We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    I would use CAPTCHA here, but it doesn’t want to work on my server...

    Is there any way to have a field in EForm like, "2+3=?", and make it so the value MUST be 5 to submit the form? EForm is going to be used to create Web User accounts (via EFreg), and I’ve noticed some spam accounts lately.

    So something like this would help out a lot, since the spam bots likely couldn’t solve that problem correctly.
      My Snippets
      -> PopUpChunk v1.0
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      Quote from: Soshite at Jun 25, 2007, 06:58 PM

      I would use CAPTCHA here, but it doesn’t want to work on my server...

      Is there any way to have a field in EForm like, "2+3=?", and make it so the value MUST be 5 to submit the form? EForm is going to be used to create Web User accounts (via EFreg), and I’ve noticed some spam accounts lately.

      So something like this would help out a lot, since the spam bots likely couldn’t solve that problem correctly.

      "Where there’s a Will, there’s a way" ...and if it’s in MODx, then there’s generally a Shortcut!

      Let’s see...you could create a custom MySQL table containing a series of algebraic equations like above in one column, and the correct answer in another. Give the table an auto_increment `id` column, too.

      Randomly select 1 row (ID) and store it in a PHP Session. You’ll need to display the associated equation for that ID, so you’ll have to use eFormOnBeforeFormMerge to properly build your form.

      Set up the answer as a non-required field (so eForm doesn’t steal control) then use eForm’s function/event handlers (probably eFormOnBeforeMailSent ?) to further control/validate your form submission.

      You’ll want to query the table based on the row ID in Session to retrieve the correct answer, which you can then compare to the answer from the form submission.

      If they match,
      return true
      and you should be set. If not,
      return false
      and override the existing equation ID in Session with a different ID and repeat!
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.
        • 28033
        • 925 Posts
        Some of that I can follow, but I’m not at all experience in PHP/MySQL to implement that (I know how to debug some basic stuff, and understand some tables, but that’s about it). I know you’re probably busy, but if you had the time to give a "newbie" guide on it, that would really help out.

        If not, I can just have EForm send me a e-mail when a user signs up, and I can delete it if I deem it a spam account, although I wouldn’t want to do that unless there wasn’t another way.
          My Snippets
          -> PopUpChunk v1.0