I have a contact form and I want to avoid bots by using google recaptcha. I am getting the error: missing-input-response and I do not why I think I am following the steps right. Please help me.
Here is the code:
<form method="post" id="ContactForm" action="contact2.php">
<input placeholder="Name" type="text" name="name" id="name" >
<input placeholder="E-Mail" type="email" name="contactemail" id="contactemail">
<input placeholder="Organization Name" type="text" name="orgname" id="orgname" >
<input placeholder="Subject" type="text" name="sub" id="sub" class="StyleTxtField inputBg" style="background: url(images/subject.png) no-repeat left center; background-color:white; " required>
<textarea rows=5 cols=200 placeholder="Your e-mail" name="body" id="body" ></textarea>
<div class="g-recaptcha" data-sitekey="..."></div>
<span id="wrongcap" class="wrongInput">*Wrong !</span>
<button type="submit" id="button" class="send">Send</button>
</form>
and here how i check in contact2.php
$url= 'https://www.google.com/recaptcha/api/siteverify';
$privatekey='...';
$respnose= file_get_contents($url."?secret=".$privatekey."&response=".$_POST['g-recaptcha-respnose']);
$data = json_decode($respnose);
echo $respnose;
echo "-1";
if(isset($data->success) AND $data->success==true){
echo "0";
}else{
echo "1";
}