Ho trovato la modifica da fare per interagire con il php ma niente
codice:
<adata-toggle="modal"href="#myModal"id="1"><iclass="pull-right icon-eye-open"></i>HTML</a>
codice:
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>Title</h3>
</div>
<div class="modal-body">
<?php
$query = "SELECT * FROM table WHERE id = ID FROM JQUERY HERE";
$result = mysql_query($query) or die ('Error (' . mysql_errno() . ') ' . mysql_error());
?>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-info" data-dismiss="modal" >Close</a>
</div>
</div>
codice:
Scenario:
When the user clicks the link-element that has data-toggle="modal" then jQuery should take the value of the id-attribute (which is 1 in this case) and send it to the SQL-query so that the SQL query would look like:
$query = "SELECT * FROM table WHERE id = 1";jQuery code:
$("a[data-toggle=modal]").click(function(){
var essay_id = $(this).attr('id');
//Find $essay set it to essay_id in PHP
//Alternatively create a $_SESSION['EID'] here
});
Ma non va lo stesso