如何在PHP中调用引导程序模态

Kam*_*nda 4 html javascript php jquery twitter-bootstrap

我正在尝试调用隐藏在另一个模式旁边的html文件中的模式。当单击按钮时,其中一个出现,但是另一个将在验证过程中被php调用。

这是我的PHP代码:

$File = include("index2.html");
$Msg = 'Welcome ';
$search=$_POST['search'];
$query = $pdo->prepare("SELECT * FROM students WHERE IDs LIKE '%$search%'  LIMIT 0 , 10"); //OR author LIKE '%$search%'
$query->bindValue(1, "%$search%", PDO::PARAM_STR);
$query->execute();
// Display search result
         if (!$query->rowCount() == 0) {
                 echo '<script type="text/javascript">';
                                 echo 'alert("Verification Complete");';
                                  echo '</script>';



            while ($results = $query->fetch()) {

                $Studname = $results['Studentname'];


                echo '<script type="text/javascript">';                
                echo 'alert("'.$Msg.$Studname.'")';
                echo '</script>';



               echo '<script type="text/javascript">';
               echo '$(File).ready(function() {';
               echo '$("#myAdvert").modal("show");';
               echo '});';
               echo '</script>';

            }

         } else {
           echo '<script language="javascript">';
            echo 'alert("Sorry your ID was not found");';
            echo 'window.location.href = "/Koleesy/index.html";';
            echo '</script>';
        }
?>
Run Code Online (Sandbox Code Playgroud)

在欢迎用户之后,我希望调用index.html中的隐藏模式,以便用户可以继续提交广告。我试过使用include函数,但这似乎对我不利。我该怎么做呢?每个答案表示赞赏。

Hap*_*ing 5

尝试这个:

echo "<script type='text/javascript'>
$(document).ready(function(){
$('#myAdvert').modal('show');
});
</script>";
Run Code Online (Sandbox Code Playgroud)