title: Site search and return results in separate web page
body: <p>Hello and thanks for your help in advance. </p>
  
  <p>I want to make an internal search capability on my web site.</p>
  
  <p>A user enters a keyword in the search field and after they press enter, the result are shown on a separate web page. So if someone enters the word cat, all the web pages on my web site will be populated in a list with hyperlinks to the pages. I want this to only search my site, no google search engines.</p>
  
  <p>I want to make this in the simplest way possible to php no python, just javascript.</p>
  
  <p>I attempted to make it happen but this code just takes me to a page that has the word i searched for on it.</p>
  
  <pre><code>&lt;div id="widget-user"&gt;
  
      &lt;form id="siteSearch" method="get" action="http://www.example.com/first"&gt;
          &lt;input type="text" id="searchInput" name="q" maxlength="20"&gt;
          &lt;input type="submit" value="Search"&gt;
      &lt;/form&gt;
  
      &lt;script&gt;
  
          var a = document.getElementById("siteSearch");
          a.addEventListener("submit", function(event) {
  
              event.preventDefault();
              var b = document.getElementById("searchInput").value;
              window.location.href = "http://www.example.com/first" + b;
  
          });
  
      &lt;/script&gt;
  </code></pre>