We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    I'd like to add Google reCAPTCHA verification to my eForm due to a lot of spamming on many websites.
    I wonder if someone has already done this or knows how to intergrade it in eForm?

    https://developers.google.com/recaptcha/docs/verify

    This question has been answered by iusemodx. See the first response.

    [ed. note: fourroses666 last edited this post 8 years, 1 month ago.]
      Evolution user, I like the back-end speed and simplicity smiley
      • 13226
      • 953 Posts
      eForm 1.4.6 - modified

      Has older recaptcha version (images + numbers) + HTML5 tags

      Open recaptcha/recaptchakeys.php and enter you keys:
      $publickey = "xxxxxxxxxxxxxxxxxx";
      $privatekey = "xxxxxxxxxxxxxxxxxx";


      Calling eForm use vericode "2"
        • 9995
        • 1,613 Posts
        Thanks, going to check that out!
          Evolution user, I like the back-end speed and simplicity smiley
          • 9995
          • 1,613 Posts
          Hey Iusemodx,

          Just tested it but keeps saying, "unvalid vericode".


          • I have uploaded the eForm folder,
          • changed the recaptcha keys (added the domain to recaptcha),
          • added &vericode=`2`
          • and added the header call and div which shows the reCaptcha.


          Any idea whats going wrong?
            Evolution user, I like the back-end speed and simplicity smiley
          • discuss.answer
            • 13226
            • 953 Posts
            I actually use a custom design for the form, but have just tried with the default and it works perfectly using the following:

            Snippet Call:
            [!eForm? &formid=`MyForm` &to=`[(emailsender)]` &tpl=`formchunk` &report=`reportchunk` &thankyou=`thankyouchunk` &requiredClass=`required` &invalidClass=`required` &vericode=`2` &sendAsHtml=`1` &allowhtml=`0` &subject=`MySubject`!]

            Form Chunk:
            <div id="ctform">[+validationmessage+]
              <form method="post" action="[~[*id*]~]">
                <input type="hidden" name="formid" value="MyForm">
                <div>
                  <label for="name">Name: <em class="required">*</em><br>
                    <input type="text" name="name" id="name" eform="Name:string:1">
                  </label>
                  <label for="email">Email Address: <em class="required">*</em><br>
                    <input type="text" name="email" id="email" eform="E-mail Address:email:1">
                  </label>
                  <label for="subject">Subject: <em class="required">*</em><br>
                    <input type="text" name="subject" id="subject" eform="Subject:string:1">
                  </label>
                </div>
                <div>
                  <label for="message">Message: <em class="required">*</em></label>
                  <textarea rows="10" cols="55" name="message" id="message" eform="Message:string:1"></textarea>
                </div>
                <!-- ############## --> 
                [+captcha_html+] 
                <!-- ############## --> 
                <input type="submit" value="Send">
              </form>
            </div>


            You only need to add options in the header if you want them - using the default recaptcha you don't need anything in the header

            You also don't need to add any extra code from recaptcha - you just need the [+captcha_html+] element in the position where you want the recaptcha box to be shown.
              • 9995
              • 1,613 Posts
              Ah thanks, I see what I did wrong. I didn't use the [+captcha_html+]

              I added the new version of reCapthca in my form:
              <div class="g-recaptcha" data-sitekey="my-key-here"></div>

              The old version of reCaptcha works now, you don't have any forms with the new one?
                Evolution user, I like the back-end speed and simplicity smiley
                • 13226
                • 953 Posts
                No, I don't have any code for the new version

                The recaptcha Api has changed and as I am not a PHPr I wouldn't know where to start

                Might be something for one of the Evo DEV team - who knows smiley
                  • 13226
                  • 953 Posts
                  If you want to cutomise the recaptcha box, making it more like your design, take a look here
                    • 9995
                    • 1,613 Posts
                    Yeah, added it to Github issues as possible feature for eForm.
                    Really hate these spam mails being send so much.
                    Do you still get spam on sites with this Google chaptcha?

                    The new version of reCaptcha looks very cool!
                    Thanks again for posting the code!
                      Evolution user, I like the back-end speed and simplicity smiley
                      • 9995
                      • 1,613 Posts
                      Quote from: iusemodx at Mar 08, 2016, 11:52 AM
                      If you want to cutomise the recaptcha box, making it more like your design, take a look here

                      Cool, I like the clean version

                      Bit stupid its not responsive thow omg. [ed. note: fourroses666 last edited this post 8 years, 1 month ago.]
                        Evolution user, I like the back-end speed and simplicity smiley