title: Sava search query and stay on same page
body: <p>I am having trouble with my php code. I have tried everything and nothing works.
  I want that the form will save the search query into the database but but i canot use <code>action="search.php"</code> since the result is displayed on the index.php page so it need's to stay on the index page and execut the save.</p>
  
  <p>The form:</p>
  
  <pre><code>&lt;form class="form-domain" role="form" action="search.php" method=post&gt;
  
  &lt;!-- Search input --&gt;
  &lt;div class="search-input"&gt;
  &lt;span class="www"&gt;www.&lt;/span&gt;
  &lt;input type="text" class="form-control input-domain" placeholder="vasa-nova-domena" name="ime_domene"&gt;
  &lt;div class="domain-extension"&gt;
  &lt;select class="form-control" name="koncnica"&gt;
  &lt;option value=".com" selected=""&gt;.com&lt;/option&gt;
  &lt;option value=".si"&gt;.si&lt;/option&gt;
  &lt;/select&gt;
  &lt;/div&gt;
  &lt;/div&gt;&lt;!-- /.search-input --&gt;
  
  &lt;button class="btn btn-success btn-block" id="poslji" name="preglej" type="submit"&gt;&lt;strong&gt;PREVERI&lt;/strong&gt;&lt;/button&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Right after this form comes the php result so i need to stay on the index.php to have the result of the search visible but the same time i want the input/search that was given saved into the database.</p>
  
  <p>I hope this wasen't to complicated. :)</p>