Je mets une galerie en ligne avec photo et nom de la photo.
Seuleument voila dès que la photo a un mot avec accent la photo laisse place à une croix alors que le nom apparait correctement.
Voici le script que j'utilise
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
<SCRIPT LANGUAGE="JavaScript">
table_photo = new Array;
table_noms = new Array;
table_type = new Array;
 
<?
$a = 0;
$handle = opendir("galerie"); 
while (($file = readdir())!=false) { 
	clearstatcache(); 
	if($file!=".." && $file!=".") 
		{
 
		// RECHERCHE DU FICHIER
		echo "table_photo[$a] = 'galerie/$file';";
 
		// RECHERCHE DU TYPE DE FICHIER
		$file_type = strrchr($file, ".");
		$file_type = str_replace(".", "", $file_type);
		$file_type = strtoupper($file_type);
		echo "table_type[$a] = '$file_type';";
 
		// RECHERCHE DU NOM :
		$file_name = strtolower($file);
		$file_name = str_replace(".jpg", "", $file_name);
		$file_name = str_replace(".jpeg", "", $file_name);
		$file_name = str_replace(".gif", "", $file_name);
		$file_name = str_replace(".png", "", $file_name);
		echo "table_noms[$a] = '$file_name';";
		$a++;
		}
	}
closedir($handle); 
?>
 
function showing_photos(num)
	{
	if(document.getElementById)
		{
		diaporama_fin = "";
		if(num!=0)
			diaporama_fin += "<td height=20><p align=center><A HREF=# onClick='showing_photos("+(num-1)+");return(false)'><img border=0 src=leftarrow.png  height=35></A></td>";
		if(num!=(table_photo.length-1))
			diaporama_fin += "<td height=20><p align=center><A HREF=# onClick='showing_photos("+(num+1)+");return(false)'><img border=0 src=rightarrow.png  height=35></A></td>";
		document.getElementById("affichage_photos").innerHTML = "<div align=center><center><table border=0 width=640 cellspacing=0 cellpadding=5 height=480><tr><td colspan=2 valign=middle width=100% bgcolor=#141414 height=20><table border=0 width=100% cellspacing=0 cellpadding=0><tr><td width=50%><font color=#808080> Vue : "+table_noms[num]+"</td><td width=50%></td></tr></table></td></tr><tr><td width=100% colspan=2 valign=middle height=360><table border=0 width=100% cellspacing=1 cellpadding=0 height=100%><tr><td width=100% bgcolor=#141414 height=360><center><img src='"+table_photo[num]+"' width=400 BORDER=0></center></td></tr></table></td></tr><tr>"+diaporama_fin+"</tr></table></center></div>";
		}
	}
 
window.onload = new Function("showing_photos(0)")
</SCRIPT>
Merci d'avance pour l'aide