if (mysqli_num_rows($res_username) > 0) {
//echo "Sorry... Username already taken";
echo "<script>$('#RegisterModal').modal('show')</script>";
}
<div id="RegisterModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
You have sucess registered!
</div>
</div>
</div>
For the echo part, I want to display a modal showing a popup instead of a echo message. Anybody help?