title: How to make google ReCAPTCHA required in php
body: <p>I have one PHP form with some fields and google ReCAPTCHA field and values store in the database table, But i want to make the google ReCAPTCHA field required.
  Code here: </p>
  
  <pre><code>&lt;?PHP
  
  if(isset($_POST['submit']))
      {
  {
          $name=$_REQUEST['name'];
          $email=$_REQUEST['email'];
          $message=$_REQUEST['message'];
          $user_id=$_SESSION['id'];   
          $sql="insert into contact (name,email,message,user_id,status)
          values('$name','$email','$message','$user_id','1')";
          $qex=mysql_query($sql); 
          if(!$qex)
          {
              die("Contact information  is not Added".mysql_error());     
          }   
          $msgsec="Contact information is Added";
  ?&gt;
  </code></pre>
  
  <p>form code: </p>
  
  <pre><code>&lt;script src='https://www.google.com/recaptcha/api.js'&gt;&lt;/script&gt;
  
  
  &lt;form id='contactus' method='post' &gt;
          &lt;input type='hidden' name='submit' id='submit' value='1'/&gt;
          &lt;label&gt;&lt;h2&gt;Your Name &lt;strong style="color:red"&gt;*&lt;/strong&gt;&lt;/h2&gt;&lt;/label&gt;
              &lt;input type="text" class="form-control" required name="name" id="name" placeholder="Please enter you'r name"/&gt;
          &lt;label&gt;&lt;h2&gt;Your Email &lt;strong style="color:red"&gt;*&lt;/strong&gt;&lt;/h2&gt;&lt;/label&gt;
              &lt;input type="email" class="form-control" required name="email" id="email" placeholder="Please enter you'r email address"/&gt;
          &lt;label&gt;&lt;h2&gt;Your Message &lt;strong style="color:red"&gt;*&lt;/strong&gt;&lt;/h2&gt;&lt;/label&gt;
              &lt;textarea class="form-control" required name="message" id="message" placeholder="Please type you'r message here"&gt;&lt;/textarea&gt;
          &lt;br  /&gt;
      &lt;div class='container'&gt;
          &lt;div class="g-recaptcha" data-sitekey="6LevWB0UAAAAAEPIUh40HptW3PxfYFqjvz2Wa05D"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class='container'&gt;
          &lt;input type="submit" name="submit" class="btn btn-primary" value="SEND MESSAGE"&gt;
      &lt;/div&gt;  
    &lt;/form&gt;
  </code></pre>
  
  <p>as of now the Google ReCAPTCHA option is not required. the form details always stored with submit button wheather i click on captcha or not. i want to make Google ReCAPTCHA required. please check my code and let me know. what i am missing.</p>
  
  <p>Thanks and Regards.
  Ankit</p>