title: Blank response from jQuery Ajax call to PHP script
body: <p>I hope this isn't a duplicate; the other similar questions I read didn't help me solve my problem.</p>
  
  <p>I'm receiving a blank response (i.e. data = "") from a jQuery Ajax call to my PHP script, used to validate a user's submitted CAPTCHA value. I'm using <a href="http://www.captcha.fr/" rel="nofollow" title="Cryptographp">Cryptographp</a> for my CAPTCHA, and it works as expected, so I'm thinking it's most likely an error either in my Ajax call or the PHP script.</p>
  
  <p><strong>Firebug showing correct POST values ('code' is the submitted CAPTCHA value to test):</strong></p>
  
  <pre><code>code      a
  email     a@a.com
  emailtext a
  firstname a
  lastname  a
  phone     
  </code></pre>
  
  <p><strong>Ajax function called onsubmit to determine whether or not to submit the form:</strong></p>
  
  <pre><code>function validateCaptcha()
  {
    // Assume an invalid CAPTCHA
    var valid = false;
  
    // The form containing the CAPTCHA value
    var data_string = $('form#emailform').serialize();
  
    // Make the Ajax call
    $.ajax({
      url: "captcha.php",
      data: data_string,
      type: "POST",
      async: false,
      success: function (data) {
        if (data == "true")
        {
          valid = true;
        }
  
        alert ("data: " + data);
      }
    });
  
    return valid;
  }
  </code></pre>
  
  <p><strong>captcha.php</strong></p>
  
  <pre><code>&lt;?
    $cryptinstall="crypt/cryptographp.fct.php";
    include $cryptinstall;
  
    // Begin the session
    session_start();
  
    //Check if CAPTCHA values match
    if(chk_crypt($_POST["code"]))
      return true;
    else
      return false;
  ?&gt;
  </code></pre>
  
  <p>My expectation is that the above snippet should return a response of simply "true" or "false," but perhaps this is not the case.</p>
  
  <p>Any help pointing out my error would be greatly appreciated!</p>