php - Load a modal popup if a session exists? -


hi title suggests load modal popup if session exists on page load.

i use sort of flash message. example if form submitted php script creates success session success message in it.

then redirects previous page. on page if statement checking if success session exists echos out if , destroys session show again if page reloaded.

so instead of showing success message modal window open.

i have thought have been quite simple cant seem to it.

although sure duplicate , have been found google... yes possibly.

you like:

<?php if (isset($_session['success'])) { ?>  <div class="modal hide fade" id="mymodal">     <div class="modal-header">         <a class="close" data-dismiss="modal">×</a>         <h3>success</h3>     </div>     <div class="modal-body">         <p><?php echo $_session['success']; ?></p>     </div>     <div class="modal-footer">         <a class="close btn" data-dismiss="modal">close</a>     </div> </div>  <script type="text/javascript">     $(window).load(function () {         $('#mymodal').modal('show');     }); </script> <?php } ?> 

this purely example. lot of things differently should guide in right direction.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -