title: Could not show the modal after if condition
body: <p>I have a problem regarding bootstrap modal: I have an input box and a button, in the input box, the user should type their code, then click the check button:</p>
  
  <pre><code>&lt;form class="form-inline" action="" method="post"&gt;
    &lt;div class="form-group"&gt;
      &lt;input type="text" class="form-control input-sm input-inverse" name="appcode" required="" data-form-field="appcode" placeholder="Insert Your Code"&gt;&lt;/div&gt;
    &lt;div class="buttons-wrap"&gt;
      &lt;button name="Xcheck" class="btn btn-secondary display-4 " type="submit" role="button" data-toggle="modal" data-target="#modalID"&gt;Check&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>When the button is clicked, it will run a PHP code in the same page, also check either the inserted code exists in the database or not.</p>
  
  <p>Here is the php code:</p>
  
  <pre><code>&lt;?php
    $con= mysqli_connect("localhost", "root", "");
    mysqli_select_db($con, "cobathesis");
  
    if (isset($_POST['Xcheck'])){
      $appcode= $_POST['appcode'];
      $check=mysqli_query($con,"select * from applicantdata where appcode='$appcode'");
      $checkrows=mysqli_num_rows($check);
  
      if($checkrows&gt;0) {
          // the modal should be loaded here
      }else{
          echo "&lt;script&gt;alert('You Inserted either the wrong Code or the Code is unregistered'); location.href='';&lt;/script&gt;";
          }
    }
  ?&gt;
  </code></pre>
  
  <p>Is it possible to use the same button (check button) to post the value and  load the modal at the same time?</p>
  
  <p>Thank you for your response.</p>