title: reCAPTCHA PHP integrated but not validating
body: <p>This is my first time posting on stackoverflow. I am Designer teaching myself HTML5, CSS, Javascript &amp; PHP. I have a very basic grasp on Javascript &amp; PHP with more experience in HTML5 &amp; CSS. <em>I have been researching my issue and attempting to fix this for several weeks (when time is available) and keep coming up short.</em> Here is my issue:</p>
  
  <p>I have been working on a website with two forms. I have gone to reCAPTCHA grabbed my public &amp; private keys and added them to my website and my reCAPTCHA is displayed on the site. </p>
  
  <p>Currently, someone can enter in the reCAPTHCA correctly (or incorrectly) and the form will still submit. This is only because I have removed the else { } code in the validating php file, see below. When I add the else { } code the form will die on submit and give me "The reCAPTCHA was entered incorrectly. Go back and try it again.(reCAPTCHA said: incorrect-captcha-sol)". The code below is placed directly below my opening &lt; ?php tag.</p>
  
  <pre><code>require_once('recaptchalib.php');
  $privatekey = "myprivatekey_removed";
  $resp = recaptcha_check_answer ($privatekey,
                  $_SERVER["REMOTE_ADDR"],
                  $_POST["recaptcha_challenge_field"],
                  $_POST["recaptcha_response_field"]);
  
  if (!$resp-&gt;is_valid) {
     die ("The reCAPTCHA was entered incorrectly. Go back and try it again." .
      "(reCAPTCHA said: " . $resp-&gt;error . ")");
  } else {
     // my code
  }
  </code></pre>
  
  <p>Ultimately, does anyone know why my code is not validating even though I have entered everything correctly according to every tutorial I have found and was able to follow. I have tried entering the &lt; ?php require_once ? > sequence of code as a direct child of the &lt; form > as well as everything else in my form. I have also gone as far as not incorporating the &lt; ?php require_once ? > and end up with the same result.</p>
  
  <pre><code>&lt;form method="post" action="paperclip.php" name="submission" id="contactform" class="form c-form"&gt;
      &lt;?php
          require_once('recaptchalib.php');
          $publickey = "6LffWgATAAAAAEfZ6Q0bo57UUz5MwbA3T9dl_uWn";
          echo recaptcha_get_html($publickey);
      ?&gt;
      &lt;fieldset&gt;
          &lt;input name="name" type="text" id="name" placeholder="Your Name" /&gt;
          &lt;input name="email" type="text" id="email" placeholder="Your E-Mail" /&gt;
          &lt;textarea name="comments" id="comments" placeholder="If you are submitting an entry for the Paperclip Contest, you must include the ad name and page that the paperclip appears."&gt;&lt;/textarea&gt;
          &lt;div class="six col"&gt;
              &lt;div style="float: right;" class="g-recaptcha" data-sitekey="6LffWgATAAAAAEfZ6Q0bo57UUz5MwbA3T9dl_uWn"&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="six col"&gt;
              &lt;div class="text-align: center"&gt;
                  &lt;input type="submit" class="submit btn color" id="submit" value="Send message" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I also have the javascript line: </p>
  
  <pre><code>&lt;script src='https://www.google.com/recaptcha/api.js'&gt;&lt;/script&gt;
  </code></pre>
  
  <p>in my &lt; head > of my html file.</p>
  
  <p>Does this sound like an error inside my PHP code after the PHP validation code? If so, please let me know and I can post the remaining of my PHP file.</p>
  
  <p>Any help is greatly appreciate and I will do my best to help with any requests.</p>