0
I’m starting to learn about modal, so I looked for some examples and found one that would help me in what I need, but this with some mistake that I can’t 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, only it doesn’t 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 managed to run the code.
The variable $id picks up a selected id from the database (without the modal working perfectly).
- The delete.php function is working perfectly without the modal.**
What do you want? open the modal and be redirected to delete.php? id=<? php echo $id; ?>
– user60252
This modal is to show what?
– Sam
I plan to open the modal where opens a delete confirmation screen
– w.rock