|
|
|
|
Bonjour j'ai un site www.femsante.com avec des images aleatoire mais sans .je voudrais donc mettre des lien en php
voila le code si ca peut aider
html
.......
.....
<?php
$nbimages=5;
$nomimages[1]="img1.jpg";
$nomimages[2]="img2.jpg";
$nomimages[3]="img3.jpg";
$nomimages[4]="img4.jpg";
$nomimages[5]="img5.jpg";
srand((double)microtime()*1000000);
$affimage=rand(1,$nbimages);
?>
.........
.......
<img src="http://www.femsante.com/imagesaleatoire/<?php echo $nomimages[$affimage]?>" alt="Images aléatoire, femsante" width="144" height="120" border="0" />
........
</html
Il faut remplacer
<img src="http://www.femsante.com/imagesaleatoire/<?php echo $nomimages[$affimage]?>" alt="Images aléatoire, femsante" width="144" height="120" border="0" /> par <a href="http://www.femsante.com/imagesaleatoire/<?php echo $nomimages[$affimage]?>"><?php echo $nomimages[$affimage] ?></a> ..et le...le...enfin, non parce c'est...ya...quand...bah tu sais là le...
|
Salut
|