I've a PHP web application that manage the conversation between two users, recorded in a MySQL database. The conversation is handled by the controller PHP, which stores the messages in the database, and then invokes the PHP template. In this template i've a modal like this:
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Data review</h4>
</div>
<div class="modal-body">
<! -- CONTENT HERE -->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
The modal is opened automatically from the controller index.php, through this:
header('Location: ./#myModal');
And the controller "pass" to the modal, the message text and the sender.
The problem is that every time a user sends a message, the modal disappears and then reappears, with the new message just sent in the conversation. Is it possible to avoid the modal appear and disappear, and that will always remain in the foreground on the page?
Can anyone help me?
Any suggestions will be greatly appreciated :) Thanks!