Home › Forums › Porto – Responsive HTML5 Template › Contact Form – Google Recaptcha v3 Problem
- This topic has 11 replies, 2 voices, and was last updated 2 months, 1 week ago by Support. This post has been viewed 293 times
-
AuthorPosts
-
August 1, 2024 at 3:47 am #10045090bimtechParticipant
Hello,
I ran the contact form without captcha and successfully sent an e-mail with my smtp information.Then I entered the secretkey and sitekey information for recapcha v3. And I posted the form to work with recaptcha v3. It appears that the capcha is verified at the bottom right of the page. But when I try to send the form, it gives the error “Array ( ) {“response”:”error”,”errorMessage”:”reCaptcha Error: Invalid token. Please contact the website administrator.”}”.
I await your response, I wish you a good day.
Template Version: Theme Version: 10.2.0August 1, 2024 at 4:01 am #10045091SupportKeymasterHello, thanks for your purchase.
1) Get the original PHP file: php/contact-form-recaptcha-v3.php:
2) Change only lines:
– Line 27: https://www.okler.net/previews/porto/docs/assets/img/recaptcha-6.jpg
– Line 56: https://www.okler.net/previews/porto/docs/assets/img/recaptcha-7.jpg
August 1, 2024 at 4:09 am #10045092SupportKeymasterAlso, make sure there’s no space at the begging of the file.
https://stackoverflow.com/questions/21433086/fatal-error-namespace-declaration-statement-has-to-be-the-very-first-statement
https://stackoverflow.com/questions/31513201/fatal-error-namespace-declaration-statement-has-to-be-the-very-first-statement
August 1, 2024 at 10:22 pm #10045097bimtechParticipantHello, I did as you said, downloaded the original PHP file: php/contact-form-recaptcha-v3.php and filled in the necessary fields. But I still get the error “reCaptcha Error: Invalid token. Please contact the website administrator.”
August 1, 2024 at 10:43 pm #10045098bimtechParticipantHello, we have launched our website. http://bimtech.com.tr The issue is urgent. We are waiting for your support.
August 1, 2024 at 10:50 pm #10045099SupportKeymasterChange the class of the form:
<form id="contactForm" class="contact-form" action="php/contact-form-recaptcha-v3.php" method="POST" novalidate="novalidate">
TO:
<form class="contact-form-recaptcha-v3" action="php/contact-form-recaptcha-v3.php" method="POST" novalidate="novalidate">
And try again.
August 1, 2024 at 11:25 pm #10045101bimtechParticipantNothing has changed. Current error: “reCaptcha Error: Verification failed (no success). Please contact the website administrator.”
August 1, 2024 at 11:35 pm #10045103SupportKeymasterCan you confirm that you entered the $secret variable in the PHP file?
$secret = 'YOUR_RECAPTCHA_SECRET_KEY';
Looks like the validation secret is not correct.
Make sure you generated it for Recaptcha v3, as this: https://www.okler.net/previews/porto/docs/#googlerecaptchav3
Try to remove that key and create a new one, updating the HTML and PHP file.
August 2, 2024 at 12:47 am #10045105bimtechParticipantI created a new key as you said and put it in the relevant places in both the form and the PHP file. The problem still persists. error: reCaptcha Error: Verifcation failed (no success). Please contact the website administrator.
August 2, 2024 at 12:54 am #10045106SupportKeymasterThis reply has been marked as private.August 2, 2024 at 1:31 am #10045107bimtechParticipantThis reply has been marked as private.August 2, 2024 at 1:57 am #10045108SupportKeymasterHello, looks like your server is blocking the external verification (to Google Recaptcha), it’s limited and the settings can’t be changed.
Ask your server administrator (host provider), to enable allow_url_fopen – Set that to “on”.
Then check this page: http://bimtech.com.tr/php/phpversion.php
It should “On”
Not sure why your server is limited to that, it works for 99% of the servers with this command on PHP: ini_set(‘allow_url_fopen’, true);
- This reply was modified 2 months, 1 week ago by Support.
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.