I'm starting to learn about modal, so I looked for some examples and found one that helped me in what I need, but with some error I can not identify. The code is this:
<a href="delete.php?id=<?php echo $id; ?>" class="btn btn-sm btn-danger" data-toggle="modal" data-target="#myModal" data-customer="<?php echo $id; ?>"><i class="fa fa-trash"></i> Excluir</a>
But instead of opening modal.php it opens index.php.
If I do one of these two ways it opens the modal, but it does not get the id.
<a href="#myModal" class="btn btn-sm btn-danger" data-toggle="modal" data-target="#myModal" data-customer="<?php echo $id; ?>"><i class="fa fa-trash"></i> Excluir </a>
or
<a class="btn btn-sm btn-danger" data-toggle="modal" data-target="#myModal" data-customer="<?php echo $id; ?>"><i class="fa fa-trash"></i> Excluir </a>
** obs .:
-
Where I found this example many have managed to run the code.
-
The $ id variable takes a selected id from the database (without the modal is working perfectly).
- The delete.php function is working perfectly without the modal. **