title: How to avoid redirecting to another page after submit button
body: <p>I have created a simple form type page as follows,</p>
  <pre><code>&lt;form action=&quot;&quot; method=&quot;GET&quot; &gt;
        &lt;div class=&quot;input-group mb-3&quot;&gt;
        &lt;input type=&quot;text&quot; name=&quot;search&quot; required value=&quot;&lt;?php if(isset($_GET['search'])){echo $_GET['search']; } ?&gt;&quot; class=&quot;form-control&quot; placeholder=&quot;Search data&quot;&gt;
        &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Search&lt;/button&gt;
         &lt;/div&gt;
   &lt;/form&gt;
  </code></pre>
  <p>I need to type a text in search box(name =&quot;search&quot;) and after clicking submit I need to filter the sql data as follows.</p>
  <pre><code>&lt;?php 
       $con = mysqli_connect(&quot;10.62.96.133&quot;, &quot;root&quot;, &quot;&quot;, &quot;cdrextend&quot;);
  
        if(isset($_GET['search']))
         {
          $filtervalues = $_GET['search'];
         $query=&quot;***&quot;;
           $query_run = mysqli_query($con, $query);
  
           if(mysqli_num_rows($query_run) &gt; 0)
             {
              foreach($query_run as $items)
              {
               ?&gt;
               &lt;tr&gt;
                 &lt;td&gt;&lt;?= $items['***']; ?&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;?= $items['***']; ?&gt;&lt;/td&gt;
                                    
               &lt;/tr&gt;
               &lt;?php
            }
          }
          else
         {
           ?&gt;
            &lt;tr&gt;
             &lt;td colspan=&quot;2&quot;&gt;No Record Found&lt;/td&gt;
             &lt;/tr&gt;
           &lt;?php
          }
         }
      ?&gt;
  </code></pre>
  <p>Whenever I hit submit button after typing something in text box, it redirects to login page and I am not getting any results.Can someone show me where I have messed up?</p>