close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Problem adding reCaptcha to web form

Thread began 11/17/2020 10:44 am by s.joiner74419001 | Last modified 11/20/2020 8:31 am by Ray Borduin | 1016 views | 22 replies |

s.joiner74419001

Problem adding reCaptcha to web form

Not sure if this is going beyond forum coverage but...
Im trying to add Google reCaptcha V2 to contact form but the issue I'm having is if I reference the page that contains the reCaptcha php in the form action ( As I should do ) then the email doesn't send. So I tried putting the the action page in the 'send mail' behaviour's 'go to' page, but then reCaptcha doesn't appear to work and displays the PHP echo echo '<h2>Please check the the captcha form.</h2>';.

Ive attached the two pages.

Thanks in advance.

Attached Files
confirmation.php
contact.php
Sign in to reply to this post

Ray BorduinWebAssist

The recaptcha code should be added above the email code on the contact page.... also the server validation code should be above the email code, and usually the recaptcha code should be integrated into the server validation code for a complete integration.

Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

But the reCaptcha code contains the 'if statements' that display the 'success' 'failure' and 'unchecked' results. so how would they display if the reCaptcha code was above the email code? would I have to adapt the code for this to work? Not sure about this as I sourced the code online.

Sign in to reply to this post

s.joiner74419001

So I guess the best way to do this would be, as you said, to integrate this into the server validation. Is this something you could assist with? happy to donate a cost or go for support ticket!

Sign in to reply to this post

Ray BorduinWebAssist

If you send me the page with your reCaptcha code then I can show you how to integrate it with Server Validations.

Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

Ok great! What else do you need other than the two pages I sent you earlier? The reCaptcha code is currently on the confirmation.php page.

Sign in to reply to this post

Ray BorduinWebAssist

Here is the updated page. You could now go in and add failed validation messages for your captcha and other fields using the Validation Show If server behavior.

Attached Files
contact.php
Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

Thanks for this Ray.. Fantastic!

I've added some 'validation show if' to error messages but unfortunately captcha error message is not being hidden.

Also.. The send-email behaviour doesn't appear to be triggering.

Any Ideas?

Ive attached the page.

Sign in to reply to this post

Ray BorduinWebAssist

Try adding:
@session_start();

above line 33.

When you first view the page it doesn't have the captcha, but then once it fails it doesn't clear? Please be specific when describing the steps to reproduce an issue. That can really help me determine what the cause is.

Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

Ray I will always try and be as specific as I can.

Subsequently I don't understand what you mean by saying... 'When you first view the page it doesn't have the captcha, but then once it fails it doesn't clear?'

I've tried adding '@session_start();' above line 33 as shown in screen shot. Is this where you mean?

Consequently the Show if message for captcha is still not hiding and the email is still not sending.

Thanks in advance.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...