[PHP] passare una variabile in una finestra MODAL

AMONRA75

Nuovo Utente
25 Mar 2019
1
0
1
Salve a tutti,

ho difficoltà a passare una variabile in una finestra modal in bootstrap

questo il mio codice:

index.php
Codice:
<tr>
<td style="width: 2.00%"><img border="0" alt="" src="./icons/32/white/<?php echo $developer["currency"]; ?>.PNG" width="22" height="22"></td>
            <td style="width: 12.00%"><?php echo $developer["currency"]; ?></td>
            <td style="width: 12.50%"><?php echo $developer["amount"]; ?></td>
            <td style="width: 12.50%"><?php echo $developer["cost"]; ?></td>
            <?php echo $color; ?><?php echo percent($res)?></td>
<td style="width: 15.00%"><?php echo $developer["pricein"]; ?></td>
<td style="width: 15.00%"><?php echo $price;?></td>
            <td style="width: 10.00%"><?php $now = date_create()->format('Y-m-d H:i:s'); $diff = abs(strtotime($now) - strtotime($developer["timeon"])); echo secondsToTime($diff); ?></td>
            <td style="width: 18.00%">
            <button class="btn btn-primary btn-xs-info" data-toggle="modal" data-target="#exampleModal" data-id="<?php echo $developer["posnum"]; ?>">Info</button> <button data-toggle="modal" data-target="#myModal" class="btn btn-primary btn-xs-sell" data-id="'.$row['ID'].'">Sell</button>
modal.php (che includo nel index.php )

Codice:
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
******** QUI VORREI FAR VISUALIZZARE IL VALORE PASSATO ******
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>

qualcuno può darmi una mano?
grazie anticipatamente