title: mail function not working with google captcha
body: <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="row"&gt;
        &lt;div class="col-xs-12 col-lg-10 col-lg-offset-1"&gt;
         &lt;form method="post" action="" name="contactForm" id="contactform" class="clearfix"&gt;
          &lt;fieldset&gt;
           &lt;div class="float-left"&gt;
            &lt;div class="coolfx fadeInUp"&gt;
             &lt;!--&lt;span&gt;*Name&lt;label for="name"&gt;&lt;/label&gt;&lt;/span&gt;--&gt;
             &lt;span&gt;&lt;input type="text" id="contactName" name="name" placeholder="*Name" class="text" required&gt;&lt;/span&gt;
            &lt;/div&gt;
  
            &lt;div class="coolfx fadeInUp" &gt;
             &lt;!--&lt;span&gt;*Email&lt;label for="email"&gt;&lt;/label&gt;&lt;/span&gt;--&gt;
             &lt;span&gt;&lt;input type="email" id="contactEmail" name="email" placeholder="*Email" class="email" required&gt;&lt;/span&gt;
            &lt;/div&gt;
  
            &lt;div class="coolfx fadeInUp"&gt;
             &lt;!--&lt;span&gt;Phone&lt;label for="phone"&gt;&lt;/label&gt;&lt;/span&gt;--&gt;
             &lt;span&gt;&lt;input type="text" id="contactPhone" name="phonenumber" placeholder="Phone" class="text" required&gt;&lt;/span&gt;
            &lt;/div&gt;
           &lt;/div&gt;
  
           &lt;div class="float-right"&gt;
            &lt;div class="contactform message coolfx fadeInUp"&gt;
             &lt;!--&lt;span&gt;Message&lt;label for="message"&gt;&lt;/label&gt;&lt;/span&gt;--&gt;
             &lt;span&gt;&lt;textarea id="contactMessage" placeholder="*Message" name="message" class="textarea" required&gt;&lt;/textarea&gt;&lt;/span&gt;
            &lt;/div&gt;
           &lt;/div&gt;
          &lt;/fieldset&gt;
              &lt;div class="float-right"&gt;&lt;div class="g-recaptcha" data-sitekey="6LfsPBgTAAAAAPDkaI1HeSyDm_ecF0iihVsFYBKh"&gt;&lt;/div&gt;&lt;/div&gt;
          &lt;div class="coolfx fadeInUp"&gt;
            &lt;input name="send" type="submit" class="submit" id="submit" value="Send Email"&gt;
          &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <pre><code>&lt;?php
  
   if(isset($_POST['g-recaptcha-response']))
        $url = 'https://www.google.com/recaptcha/api/siteverify';
     $privatekey = "******************************";// hide for security
       $response = file_get_contents($url."?secret=".$privatekey."&amp;response=".$_POST['g-recaptcha-response']."&amp;remoteip=".$_SERVER['REMOTE_ADDR']);
   $data = json_decode($response);
  
  
   if (isset($data-&gt;success) AND $data-&gt;success==true) {?&gt;
  
  
  &lt;script type="text/javascript"&gt;
  $(function() {
  $("#contactform .submit").click(function() {
      var data = {
  name: $("#contactName").val(),
  email: $("#contactEmail").val(),
   phone: $("#contactPhone").val(),
  message: $("#contactMessage").val()
   };
    $.ajax({
     type: "POST",
     url: "email.php",
     data: data,
       success: function(){
      $('.success').fadeIn(1000);
        }
     });
     });
    });
  &lt;/script&gt;
  
  
    &lt;?php  }else {
            echo"this is spam"
      }?&gt;
  </code></pre>
  
  <p>I am new in j query how to use j query code inside the php code and also how to verify google captcha code  before submit a mail function nothing working . </p>
  
  <p>before google captcha working my code properly but now nothing working.</p>
  
  <p>thanks</p>