Forum » » Pour débuter » » affichage aléatoire d'images (PHP)
Posté : 15 janv. 2008 à 17:05
!PHP!<!--meta
<?php
global $cookie;
$username = $cookie[1];
if ($username == "") {
echo translate("Create</a> an account")."\n";
} else {
echo translate("Welcome")." : <a href=user.php class=header>$username</a>";
}
?>
meta-->
<?
$cpt=10;
srand((double)microtime()*1000000);
$nbr=rand(0,($cpt-1));
print ("<img
src='/photos_accueil/photo$nbr.jpg' alt=''></a>");v
?>
!PHP!meta
");v
?>
meta-->
Cet article provient de NPDS
https://www.npds.org/viewtopic.php?topic=23210&forum=10