title: Autocomplete Textbox fetching suggestions from database?
body: <p>I have created 2 autosuggest textboxes in which one is fetching data from server-side and another is fetching data from client-side.But server-side textbox is not working.Can anyone point out the error in my code.</p>
  
  <p>Following is my HTML Code:</p>
  
  <pre><code>&lt;html&gt;
    &lt;link type="text/css" rel="stylesheet" media="all" href="jquery-ui-1.8.9.custom.css" /&gt; 
    &lt;script type="text/javascript" src="jquery-1.4.4.min.js"&gt;&lt;/script&gt; 
    &lt;script type="text/javascript" src="jquery-ui-1.8.9.custom.min.js"&gt;&lt;/script&gt; 
    &lt;script type="text/javascript" src="languages.js"&gt;&lt;/script&gt; 
    &lt;body&gt;
      &lt;label for="languagesClientInput"&gt;Select Language(client-side): &lt;/label&gt;
      &lt;input id="languagesClientInput" /&gt;
      &lt;br /&gt;
      &lt;label for="languagesServerInput"&gt;Select Language (server-side): &lt;/label&gt;
      &lt;input id="languagesServerInput" /&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Following is Js Code:</p>
  
  <pre><code>$(function() {
      var languages = [
           "C",
    "C++",
    "Core Java",
    "Advance Java",
    "PHP",
    ".NET",
    "XML",
    "HTML",
    "Javascript",
    "jQuery",
    "JSON",
    "Ajax",
    "C#",
    "ABC ALGOL",
    "ADA",
    "ABLE",
    "COBOL",
    "BLUE",
    "Pearl",
    "Python",
    "Oracle",
    "Haskell",
    "BASIC",
    "BeanShell",
    "Bliss",
    "BETA",
    "GOTRAN",
    "FORTRAN",
    "Focal",
    "Genie",
    "GOAL",
    "GROOVY",
    "JOSS",
    "JEAN",
    "JOVIAL",
    "JOY",
    "Maple",
    "MATLAB",
    "MORTAN",
    "MUMPS",
    "Miranda",
    "NetRexx",
    "NPL",
    "NXT-G"
      ];
  
  $("#languagesClientInput").autocomplete( { source: languages });
  $("#languagesServerInput").autocomplete( { source: "languages.php" });
  
  });
  </code></pre>
  
  <p>Following is Php Code:</p>
  
  <pre><code>&lt;?php
  
  $searchTerm = $_GET['term'];
  
  $languages = array(
    "C",
    "C++",
    "Core Java",
    "Advance Java",
    "PHP",
    ".NET",
    "XML",
    "HTML",
    "Javascript",
    "jQuery",
    "JSON",
    "Ajax",
    "C#",
    "ABC ALGOL",
    "ADA",
    "ABLE",
    "COBOL",
    "BLUE",
    "Pearl",
    "Python",
    "Oracle",
    "Haskell",
    "BASIC",
    "BeanShell",
    "Bliss",
    "BETA",
    "GOTRAN",
    "FORTRAN",
    "Focal",
    "Genie",
    "GOAL",
    "GROOVY",
    "JOSS",
    "JEAN",
    "JOVIAL",
    "JOY",
    "Maple",
    "MATLAB",
    "MORTAN",
    "MUMPS",
    "Miranda",
    "NetRexx",
    "NPL",
    "NXT-G"
  );
  
  function filter($language) {
    global $searchTerm;
    return stripos($language, $searchTerm) !== false;
  }
  
  print(json_encode(array_values(array_filter($languages, "filter"))));
  
  ?&gt;
  </code></pre>