Popular
Newest
Updated
Sign in
Create an account
Categories
Admin Templates
203
Multipurpose Templates
164
Landing Pages
149
Portfolios & Resumes
86
Ecommerce
46
Blogs & Magazines
26
Directories & Listings
26
UI Kits & Website Builders
10
Documentation
5
Specialty
105
Topics
General
276
Business & Corporate
118
Design & Creative Services
114
Apps & Software
54
Retail & Shopping
34
Startups & SaaS
27
Marketing & Conversion
21
Restaurants & Cafes
17
Education & Learning
16
Jobs & Hiring
15
See all →
Compatible with
Bootstrap
774
PHP
41
React
41
Tailwind CSS
37
Laravel
26
Python
24
Angular
23
Django
20
Vue.js
20
ASP.NET Core
14
See all →
Discussion on
RINJANI - Multi-Purpose One Page Theme
Details
Discussion
Back to discussions
Showing 1 – 2 of 2 replies
←
1
→
I have this installed, and I really […]
dynsight
PURCHASED
7 years ago
Hi,
I have this installed, and I really like it. However, I cannot get Google Recaptcha to work. It has an error message (www.dynamicsights.com)
What i did is I put my recaptcha code at the beginning of send_mail.php:
require 'PHPMailer/PHPMailerAutoload.php';
//check the recaptha
$secret="secret codefords";
$response=$_POST["g-recaptcha-response"];
$verify=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}");
$captcha_success=json_decode($verify);
echo "URL is: https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}";
echo "<p>error codes are". $captcha_success->error-codes."</p>";
if ($captcha_success->success==false) {
echo "post is" & $_POST["g-recaptcha-response"]& "<br/>";
echo "success is: "& $captcha_success;
echo "<p>You are a bot! Go away!</p>";
}
else if ($captcha_success->success==true) {
$host = 'mail.dynamicsights.com';
$username = 'contactform@dynamicsights.com';
....rest of your code, unchanged.
However, it keeps generating an error and does not send form
Reply
dynsight
PURCHASED
7 years ago
Oddly the mail is actually sent, but the Json sends a failure message, and the user is told that there was an error sending message, but there was not
Reply
dynsight
PURCHASED
7 years ago
Okay, I got it work.. I need to remove all echo statements completely.... I am guessing that there is a better way of doing this, and looking forward to your suggestion
Reply
Close
I have this installed, and I really […]
I have this installed, and I really like it. However, I cannot get Google Recaptcha to work. It has an error message (www.dynamicsights.com)
What i did is I put my recaptcha code at the beginning of send_mail.php:
require 'PHPMailer/PHPMailerAutoload.php';
//check the recaptha
$secret="secret codefords";
$response=$_POST["g-recaptcha-response"];
$verify=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}");
$captcha_success=json_decode($verify);
echo "URL is: https://www.google.com/recaptcha/api/siteverify?secret={$secret}&response={$response}";
echo "<p>error codes are". $captcha_success->error-codes."</p>";
if ($captcha_success->success==false) {
echo "post is" & $_POST["g-recaptcha-response"]& "<br/>";
echo "success is: "& $captcha_success;
echo "<p>You are a bot! Go away!</p>";
}
else if ($captcha_success->success==true) {
$host = 'mail.dynamicsights.com';
$username = 'contactform@dynamicsights.com';
....rest of your code, unchanged.
However, it keeps generating an error and does not send form