title: how to display php search results in bootstrap modal? And Modal is disappearing after displaying results?
body: <p>i am developing a job portal where users search the jobs, while they searches the results should be shown in bootstrap pop-up modal, my code is working but modal is disappearing after immediately showing results </p>
  
  <p>i tried the code as below </p>
  
  <pre><code>  &lt;form action="" method="post"&gt;
      &lt;div class="input-group" id="adv-search"&gt;
        &lt;input type="text" name="term" class="form-control" placeholder="Search for jobs" /&gt;
        &lt;div class="input-group-btn"&gt;
          &lt;div class="btn-group" role="group"&gt;
            &lt;button type="submit" name="submit" value="search" class="btn btn-primary"data-toggle="modal" data-target="#myModal"&gt;
              &lt;span class="glyphicon glyphicon-search" aria-hidden="true"&gt;&lt;/span&gt;
            &lt;/button&gt;
          &lt;/div&gt;
         &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/form&gt;
  
    &lt;div id="myModal" class="modal fade in" role="dialog"&gt;
      &lt;div class="modal-dialog"&gt;
        &lt;!-- Modal content--&gt;
        &lt;div class="modal-content"&gt;
          &lt;div class="modal-header"&gt;
            &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
            &lt;h4 class="modal-title"&gt;Job Results&lt;/h4&gt;
          &lt;/div&gt;
  
          &lt;div class="modal-body"&gt;
          &lt;?php if($_POST['submit']=='search') {
            $status='active';
            $term =  $_POST['term'];     
            $sql = "SELECT * FROM job WHERE status='$status' AND (  jdesc LIKE '%".$term."%' OR  jtitle LIKE '%".$term."%' ) "; 
            $result = $conn-&gt;query($sql); 
            ?&gt;
  
            &lt;table class="table  table-responsive  table-inverse table-hover table-striped"&gt;
              &lt;thead&gt;
                &lt;tr&gt;
                  &lt;th&gt;JOB Title&lt;/th&gt;
                  &lt;th&gt;DURATION&lt;/th&gt;
                  &lt;th&gt;BUDGET&lt;/th&gt;
                  &lt;th&gt;KEY SKILLS&lt;/th&gt;
                  &lt;th&gt;JOINING DATE&lt;/th&gt;
                  &lt;th&gt;EXPIRY DATE&lt;/th&gt;
                  &lt;th&gt;EXPERIENCE MINIMUM&lt;/th&gt;
                  &lt;th&gt;EXPERIENCE MAXIMUM&lt;/th&gt;
                &lt;/tr&gt;
              &lt;/thead&gt;
  
              &lt;tbody&gt;
                &lt;?php while ($row = $result-&gt;fetch_array()) { ?&gt;
                &lt;tr&gt;                                    
                  &lt;td&gt;&lt;p&gt;&lt;a href="/showjob?jid=&lt;?php echo $row['jid']; ?&gt;"&gt;&lt;?php echo $row['jtitle']; ?&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;&lt;?php echo $row['duration']; ?&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;&lt;?php echo $row['budget']; ?&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;&lt;?php echo $row['keyskills']; ?&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;&lt;?php $jdate=strtotime( $row['jdate']);  echo date('d/M/Y',$jdate); ?&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;&lt;?php echo $row['edate']; ?&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;&lt;?php echo $row['cdexmin']; ?&gt;&lt;/p&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;p&gt;&lt;?php echo $row['cdexmax']; ?&gt;&lt;/p&gt;&lt;/td&gt; 
                &lt;/tr&gt;
              &lt;?php } //Endif while
             } //Endif _POST ?&gt;
             &lt;/tbody&gt;
           &lt;/table&gt;
         &lt;/div&gt;
  
         &lt;div class="modal-footer"&gt;
           &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
         &lt;/div&gt;
       &lt;/div&gt;
     &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>