title: How to call bootstrap modal in php
body: <p>I'm trying to call a modal that I have in a html file which is hidden alongside another modal. One of them appears as the button is clicked but the other one is to be called by php as part of a verification process. </p>
  
  <p>Here is my php code:</p>
  
  <pre><code>$File = include("index2.html");
  $Msg = 'Welcome ';
  $search=$_POST['search'];
  $query = $pdo-&gt;prepare("SELECT * FROM students WHERE IDs LIKE '%$search%'  LIMIT 0 , 10"); //OR author LIKE '%$search%'
  $query-&gt;bindValue(1, "%$search%", PDO::PARAM_STR);
  $query-&gt;execute();
  // Display search result
           if (!$query-&gt;rowCount() == 0) {
                   echo '&lt;script type="text/javascript"&gt;';
                                   echo 'alert("Verification Complete");';
                                    echo '&lt;/script&gt;';
  
  
  
              while ($results = $query-&gt;fetch()) {
  
                  $Studname = $results['Studentname'];
  
  
                  echo '&lt;script type="text/javascript"&gt;';                
                  echo 'alert("'.$Msg.$Studname.'")';
                  echo '&lt;/script&gt;';
  
  
  
                 echo '&lt;script type="text/javascript"&gt;';
                 echo '$(File).ready(function() {';
                 echo '$("#myAdvert").modal("show");';
                 echo '});';
                 echo '&lt;/script&gt;';
  
              }
  
           } else {
             echo '&lt;script language="javascript"&gt;';
              echo 'alert("Sorry your ID was not found");';
              echo 'window.location.href = "/Koleesy/index.html";';
              echo '&lt;/script&gt;';
          }
  ?&gt;
  </code></pre>
  
  <p>After the user is welcomed I want the hidden modal from my index.html to be called so the user can continue submitting the advert.
  I've tried using the include function but that doesn't seem to work in my favor.
  How do I do this? 
  Every answer is appreciated. </p>