- <?
- //////////////////////////////////////////////////
- //////////////////////////////////////////////////
- $carburant="images"; //nom du dossiers////
- //////////////////////////////////////////////////
- //////////////////////////////////////////////////
-
- //ouverture dossier
- $dossier=opendir($carburant."/");
- //initialisation du compteur
- $i=1;
- //tant qu'il y a des fichier on les tests
- while($image=readdir($dossier))
- {
- //si on trouve .gif.jpg.png on incrémente le compteur
- if(eregi(".gif",$image) || eregi(".jpg",$image) || eregi(".png",$image))
- {
- $nom_fichier[$i]=$image;//on place le nom du fichier dans un tableau
- $i++;//on incrémene
- }
- }
- $max=$i;//récupération du nombre total d' images
- //récup du numéro img + initialisaton valeur
- if(empty($_GET["numero"]) || $_GET["numero"]>$max-1)
- {
- $numero=1;
- }
- else
- {
- $numero=$_GET["numero"];
- }
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>visionneuse</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- </head>
- <body link="#999999" vlink="#999999" alink="#999999" onLoad="focus()">
- <span style="position:absolute; left:0; top:0; z-index:1">
- <?
- $moteur=pathinfo($PHP_SELF);
- $next=$numero+1;
- if($next>$max-1){//permet de passer de la dernière image à la première
- $next=1;
- }
- echo'<a href="'.$moteur["basename"].'?numero='.$next.'"><img src="'.$carburant.'/'.$nom_fichier[$numero].'"></a>';
- ?>
- </span>
- </body>
- </html>
<?
//////////////////////////////////////////////////
//////////////////////////////////////////////////
$carburant="images"; //nom du dossiers////
//////////////////////////////////////////////////
//////////////////////////////////////////////////
//ouverture dossier
$dossier=opendir($carburant."/");
//initialisation du compteur
$i=1;
//tant qu'il y a des fichier on les tests
while($image=readdir($dossier))
{
//si on trouve .gif.jpg.png on incrémente le compteur
if(eregi(".gif",$image) || eregi(".jpg",$image) || eregi(".png",$image))
{
$nom_fichier[$i]=$image;//on place le nom du fichier dans un tableau
$i++;//on incrémene
}
}
$max=$i;//récupération du nombre total d' images
//récup du numéro img + initialisaton valeur
if(empty($_GET["numero"]) || $_GET["numero"]>$max-1)
{
$numero=1;
}
else
{
$numero=$_GET["numero"];
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>visionneuse</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body link="#999999" vlink="#999999" alink="#999999" onLoad="focus()">
<span style="position:absolute; left:0; top:0; z-index:1">
<?
$moteur=pathinfo($PHP_SELF);
$next=$numero+1;
if($next>$max-1){//permet de passer de la dernière image à la première
$next=1;
}
echo'<a href="'.$moteur["basename"].'?numero='.$next.'"><img src="'.$carburant.'/'.$nom_fichier[$numero].'"></a>';
?>
</span>
</body>
</html>