title: how to connect with ajax to php and show the results with a button onclick
body: <p>i do this but didnt connect to php and show me the response xml can anyone tell me how that gone to work </p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
          function showhint(str) {
              var ajax = new XMLHttpRequest();
  
          ajax.onreadystatechange = function () {
              if (ajax.readyState == 4 &amp;&amp; ajax.status == 200) {
                  document.getElementById("results").innerHTML = ajax.responseXML;
              }
          };
  
          ajax.open("GET","xmlconvert.php?q="+str,true);
          ajax.send();                  
      }
   &lt;/script&gt; 
  
  &lt;script&gt;
      function void  functionvalue(){
      var bookname = document.getElementById('book').value;
      return bookname;
      }
  &lt;/script&gt;
  
  &lt;form id="keyword" &gt;
      &lt;input type="text" name="value" id="book"&gt;
      &lt;br&gt;
      &lt;button  onclick="showhint(functionvalue())"&gt;Search By Title&lt;/button&gt;
  &lt;/form&gt;
  &lt;div id="results"&gt;
  </code></pre>
  
  <p>php->mysql query:</p>
  
  <pre><code>$a=$_GET["q"];
  $sql="select * from `book` where title=$q;";
  </code></pre>