Passage de variable avec href
Bonsoir,
J'ai besoin de récupérer une variable via un clic sur un href.
Le code suivant m'affiche $art comme résultat :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
<?php
$i = 0;
while
($tab = mysql_fetch_array($res)){
$i = $i + 1;
?>
<table>
<tr>
<td>
<img src="<?php echo $tab['IMAGE']; ?>">
</a>
</td>
<td>
<?php $art=$tab['NOM'];?>
<a href="affichage.php?art=$art"><?php echo $art ?><a>
<br>
<?php echo $tab['GENRE'];?>
</td>
</tr>
<?php } ?> |
Code dans la page affichage.php :
Code:
1 2 3 4 5 6
|
<?php
$nom=$_GET['art'];
echo $nom;
?> |
l'url affiche toujours /affichage.php?art=$art