Bonjour,
Je voudrai afficher mes photos en utilisant ce code, mais j'obtiens une page blanche, et sur l'adresse de la page j'ai : http://localhost/Site-php/galerie.php
Mon répertoire photo se trouve sur la même racine que ma page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Document sans nom</title>
</head>
<body>
<DIV ID=ejs_photo_box></div>
<script type="text/javascript">
ejs_photo = new Array;
<?
$a = 0;
$handle = opendir("photos");
while (($file = readdir())!=false) {
clearstatcache();
if($file!=".." && $file!=".")
{
echo "ejs_photo[$a] = 'photos/$file';
";
$a++;
}
}
closedir($handle);
?>
function ejs_aff_photos(num)
{
if(document.getElementById)
{
ejs_fin = "";
if(num!=0)
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num-1)+");return(false)'>< Précédent</A> ";
if(num!=(ejs_photo.length-1))
ejs_fin += "<A HREF=# onClick='ejs_aff_photos("+(num+1)+");return(false)'>Suivant ></A>";
document.getElementById("ejs_photo_box").innerHTML = "<CENTER><IMG SRC='"+ejs_photo[num]+"' BORDER=0><BR>"+ejs_fin+"</CENTER>";
}
}
window.onload = new Function("ejs_aff_photos(0)")
</script>
</body>
</html>
Merci pour votre aide.
Salutations