<?php
include ('menu.php');
include ('Connection.php');
?>
<br><br>
<?php
$p = $_GET["p"];
if ($handle = opendir("A_l'affiche")) {
$i = 1;
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..") {
$img[$i] = $file;
if ($p == $img[$i]) {
$ci = $i;
}
$i++;
}
}
closedir($handle);
$ti = $i - 1;
$pi = $ci - 1;
if ($p == "") {
$ni = $ci + 2;
} else {
$ni = $ci + 1;
}
$prevNext = "";
if ($pi > 0)
{
$piFile = $img[$pi];
$prevNext .= "<a href=\"" . $_SERVER['PHP_SELF'] . "?p=" . $piFile . "\" title=\"show previous image\">«</a>";
} else {
$prevNext .= "«";
}
$prevNext .= " | ";
if ($ni <= $ti) {
$niFile = $img[$ni];
$prevNext .= "<a href=\"" . $_SERVER['PHP_SELF'] . "?p=" . $niFile . "\" title=\"show next image\">»</a>";
} else {
$prevNext .= "»";
}
if ($p == "") {
$p = $img[1];
}
}
$albumName = "Soirée"; // Name your album!
?>
<html>
<head>
<title><?php echo $albumName; ?></title>
<body>
<center><h1><?php echo $albumName; ?></h1></center>
<div class="hRule"></div>
<table border="0" cellpadding="0" cellspacing="0" align="center">
<tr align="center">
<td><a href="inscription.php"><img src="A_l'affiche/<?php echo $p; ?>" alt="<?php echo $$albumName; ?>" border="10"></td></a>
</tr>
<tr align="center">
<td class="nextPrevious"><?php echo $prevNext; ?></td>
</tr>
</table>
</body>
</html>
Merci de m'aider