0
I bring a PHP/Mysql listing from which I open a product description in a modal window. The code is as follows:
Page list-products.php
while($jm = mysqli_fetch_object($sql)){
$listar = "<a href=\"ver-produtos.php?Key=".$jm->IdCodProdutos."\" data-toggle=\"modal\" data-target=\"#myModal\" class=\"btn btn-xs btn-primary\">Ver currículo</a></div>";
}
Modal
<!-- Modal -->
<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>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
Page ver-products.php
// teste
echo $_REQUEST['Key'];
The window opens correctly, but you need to update the product listing page to get the other Key.
Hello Kadu. Right. I made the changes, only the see-products.php link opens in a new tab and not in modal.
– user24136
Opa @Jose.Marcos. You are using jQuery? You changed PHP by adding the attribute
data-toggle=\"meumodal\"
in the link?– KaduAmaral
I updated the code for a better version...
– KaduAmaral
Perfect Kadu. Thanks for your help.
– user24136