Je te remercie ton aide ma était très précieuse
j'ai essayer le code que tu ma passer mais sa ne fonctionné pas donc j'ai remplace :
<a href="del.php?id="'.$donnees['id'].'" title="Delete this content">
par cela :
1 2
|
<a href="del.php?id= <?php echo $donnees['id']?>" <title="Delete this content"><img src="img/icons/actions/delete.png" |
et sa a fonctionner l'id de l'enregistrement a supprimé passe par l'url jusqu'au fichier del.php.
aurais tu une solution pour sécurisé un peux plus cette méthode car n'importe qui peut supprimer un enregistrement de ma base juste en modifiant l'url .
et que pence tu du code ?
merci de ton aide sa ma beaucoup beaucoup fais avancé .
voici le code entier :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<?php
{
$bdd= new PDO('mysql:host=localhost;dbname=tuto','root','root');
}
$reponse = $bdd->query('SELECT * FROM user ');
while ($donnees = $reponse ->fetch())
{
?>
<tr>
<td><input type="checkbox" /></td>
<td><?php echo $donnees['id']; ?></td>
<td><a href="#"><?php echo $donnees['login']; ?></a></td>
<td><a href="#"><?php echo $donnees['pass']; ?></a> , <a href="#"></a></td>
<td><a href="#"><?php echo $donnees['role']; ?></td>
<td>35</td>
<td class="actions"> <a href="del.php?id= <?php echo $donnees['id']?>" <title="Delete this content"><img src="img/icons/actions/delete.png" alt="" /></a></td>
<?php
}
$reponse->closeCursor();
?> |
Partager