title: how to know whether php file handling the ajax request or not
body: <p>I've this code snippet for <code>ajax</code> request:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function() {
              $('#temp').click(function() {
                  var username = $('#un').val();
                  $.ajax({
                      url: "inter.php",
                      data: 'user=' + username,
                      cache: false,
                      type: 'GET',
                      success: function(data, textStatus, jqXHR) {
                          if (! data.length === 0) {
  
                              $('#msg').append('available');
                              $('#sub').removeAttr('disabled');
                          } else {
  
                              $('#msg').append("Username not available");
                              $('#sub').attr('disabled', 'true');
                          }
                      }
                  });
              });
          });
      &lt;/script&gt;
  </code></pre>
  
  <p>and the code in <strong>inter.php</strong></p>
  
  <pre><code>&lt;?php
  
  $arr = array('one', 'two', 'three');
  if (in_array($_GET['user'], $arr)) {
      echo "Username available";
  } else {
      //echo "0";
  }
  ?&gt;
  </code></pre>
  
  <p>But, every time I'm getting the message <code>Username not available</code>.<br>
  Can anybody help? I'm newbie to <code>ajax</code>.</p>
  
  <p><strong>EDIT</strong><br>
  $_GET['user']<br>
  But the same problem remains.</p>