Bonjour,
J'ai un script php qui liste tous les fichiers présents sur mon site, et les affiche avec des icones différentes selon les types. Mais pour le type image et htm/html, j'ai un problème : il m'affiche l'entrée avec la bonne icone, plus une autre entrée avec l'icone 'indefini'. Voilà la partie en cause de mon script :
$type = str_replace('.','',strstr($Entry, '.'));
if( $type == "gif" or $type == "jpg" or $type == "png")
{
echo '<li><img src="images/images.gif"width="30"height="30">'.$Entry;
echo ' <a href ="telecharger.php?fichier='.$Entry.'&chemin='.$Directory.'">télécharger</a>';
echo ' <a href ="'.$Directory.'/'.$Entry.'">voir</a></li>';
}
if( $type == "html" or $type == "htm")
{
echo '<li><img src="images/htm.gif"width="30"height="30">'.$Entry;
echo ' <a href ="telecharger.php?fichier='.$Entry.'&chemin='.$Directory.'">télécharger</a>';
}
if( $type == "php")
{
echo '<li><img src="images/php.gif"width="30"height="30">'.$Entry;
echo ' <a href ="telecharger.php?fichier='.$Entry.'&chemin='.$Directory.'">télécharger</a>';
}
else{
echo '<li><img src="images/fichier.gif"width="30"height="30">'.$Entry;
echo ' <a href ="telecharger.php?fichier='.$Entry.'&chemin='.$Directory.'">télécharger</a></li>';
}
Et le résultat :
http://tutoflash.e3b.org/test/listing.php
Afficher la suite