I want to pass product id to popup window in the same page.how to pass id to popup window?this is my code:
Display all products from table:
<?php $data = mysql_query("select * from tbl_product") ;
while($dat=mysql_fetch_array($data))
{
$id=$dat['id']
?>
<a href="<?php echo $id ?> " class="mymodel" data-detail-id=<?php echo $id ?> data-toggle="modal" data-target="#myModal">
<div class="col-sm-4 col-xs-12" style="cursor:pointer;">
<div class="col-md-12" >
<img src="../helios/admin/product_image/<?php echo $dat['image'] ?>" >
<h4><?php echo $dat['name'] ?></h4>
</div></div></a>
<?php } ?>
javascript:
<script type="text/javascript">
$('#myModal').on('shown.bs.modal', function () {
$('#myInput').focus()
})</script>
Popup Window code:
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<?php
$data = mysql_query("select * from tbl_product where id='$id'") ;
while($dat=mysql_fetch_array($data))
{
$id=$dat['id'] ;
}
?>
<div class="col-md-6" style="margin-bottom:30px;">
<?php echo $id ?>
</div>
</div></div>
how can i do this.?