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
| <?php
$dirname = '../../webform';
//ouvrir webform
$dir = opendir($dirname);
//extension autorisé
$extensions_ok_array = array('jpg', 'jpeg', 'gif', 'png');
//fichier a cacher
$fichier_cacher = array('css','js','temp_webform','..','.',$dirname.$file);
while($file = readdir($dir)) {
//si dossier différent de dossier suivant :
if(file_exists($file) && in_array($fichier_cacher))
{
//afficher lien ../../webform/dossier
echo '<a href="'.$dirname."/".$file.'" style="text-decoration:none">' ;
//pour chaque dossier image contenant un logo
foreach (("img/logo.*") as $filename){
//si logo existe avec les exetnsion autorisé
if (file_exists($filename) && in_array(strtolower(pathinfo($filename, PATHINFO_EXTENSION)), $extensions_ok_array)){
//afficher l'image
echo' <img class="lien" src="'.$file.'/'.$filename.'" alt="logo" id="client"></a>';
}
}
}
}
closedir($dir);
?> |