- This topic has 1 reply, 2 voices, and was last updated 4 years, 10 months ago by
Support. This post has been viewed 1390 times
-
AuthorPosts
-
August 28, 2021 at 11:14 pm #10039248
hidroxid
ParticipantHello there
I have built my forms using the “Contact-form Basic”.
The same .php file elaborates the html to be displayed and when it receives the $ _POST with the submit button, it proceeds to carry out the validations and send the mail. All work like a charm.
The question:
This way in which I have built my forms does not allow the correct incorporation of reCAPTCHA v3?
I ask because in your examples, you have the html code in a file (.html) and the validation code.
I try to add the extra code for use the reCAPTCHA and have errors, seem to be related to the headers when i get the return from the code .js in contact-form.
I only need to know that there is no problem with this way of forms (one .php) or when use reCAPTCHA is necessary use separated files and have to change my structure of forms.
Thanks.
August 31, 2021 at 6:57 am #10039269Support
KeymasterHello,
At really the “Contact Us – Basic” and the “Contact Us – Recaptcha (v3)” are very similar. We just need some changes in the HTML and PHP.
1) First change the
<form>tag to:<form class="contact-form-recaptcha-v3" action="php/contact-form-recaptcha-v3.php" method="POST">.........</form>
2) Add the below script on footer of page:
<script id="google-recaptcha-v3" src="https://www.google.com/recaptcha/api.js?render=YOUR_RECAPTCHA_V3_SITE_KEY_GOES_HERE"></script>
3) Make sure you have the script
view.contact.jsincluded on footer of the page.4) Open the
php/contact-form-recaptcha-v3.phpand change the variable$secretwith your Google Recaptcha V3 Secret Key. Also, change the variable$emailto define which email should receive the contacts. You can compare your current PHP code with thephp/contact-form-recaptcha-v3.php, you will see that’s very similar.In resume, to get the recaptcha V3 working you need the mentioned changes in the HTML and use the
php/contact-form-recaptcha-v3.php. Ah, and make sure to have theview.contact.jsscript included on footer of the page.Please try that and let us know if you need further assistance.
Kind Regards,
Okler Themes.
If you are satisfied with Porto HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.