title: jQuery AJAX and PHP return true/false
body: <p>I would like to know how to retrieve a return true or return false from a PHP script using jQuery AJAX. This is my current ajax call code which works just fine aside from always directing to the profile page of the entered username even if the login wasn't actually successful...</p>
  
  <pre><code>    $("#signInForm").submit(function() {
          $(document).ajaxStart(function() {
              $("#loading" ).show();
          });
          $.ajax({
              url: "/ajax/signIn.php", // Action of the form
              data: $("#signInForm").serialize(), // Send forms data to server
              dataType: "JSON", // Take response as JSON
              type : "POST", // Send form by post or get
              complete: function(result) {
                  $(document).ajaxStop(function() {
                      $("#loading" ).hide();
                  });
                  $("#ajaxResponse").html(result.responseText);
                  $("#ajaxResponse").slideDown("slow");
                  var username = $("#usernameSignIn").val();
                  setTimeout(function() {
                      window.location.href = "/profile.php?username=" + username;
                  }, 3000);
              }
          });
          return false;  // Default submit return false
      });
  </code></pre>