0
我想,如果一個PHP會話存在檢查來顯示一個模式,下面是代碼:顯示PHP中的引導模式,而無需使用觸發按鈕
<?php if(isset($_SESSION['login'])) { ?>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>Body</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
</div>
<script>$("#myModal").modal("show");</script>
<?php } ?>
這是行不通的。
我也提到了以前的類似問題,但他們沒有給出清晰的圖片。請幫助。
可能會話未設置? – guradio
我已經勾選了在if語句中放置一個echo語句。它設置了 – bargad
包含js和所有相關的代碼:) – guradio