Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $urlphoto = "http://localhost/images";
- $nomRepertoire = "images";
- if (is_dir($nomRepertoire))
- {
- $dossier = opendir($nomRepertoire);
- while ($Fichier = readdir($dossier))
- {
- if ($Fichier != "." AND $Fichier != ".." AND (stristr($Fichier,'.gif') OR stristr($Fichier,'.jpg') OR stristr($Fichier,'.png') OR stristr($Fichier,'.bmp')))
- {
- $h_vign = "120";
- $taille = getimagesize($nomRepertoire."/".$Fichier);
- $reduc = floor(($h_vign*100)/($taille[1]));
- $l_vign = floor(($taille[0]*$reduc)/100);
- echo '<a target="_blank" href="', $urlphoto, '/',$Fichier, '">';
- echo '<img src="', $urlphoto, '/',$Fichier, '" ';
- echo "width='$l_vign' height='$h_vign'>";
- echo "</a> ";
- }
- }
- closedir($dossier);
- }else{
- echo' Le répertoire spécifié n\'existe pas';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement