Advertisement
Guest User

Untitled

a guest
Nov 17th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <?php
  2.  
  3. $urlphoto = "http://localhost/images";
  4.  
  5. $nomRepertoire = "images";
  6. if (is_dir($nomRepertoire))
  7. {
  8. $dossier = opendir($nomRepertoire);
  9. while ($Fichier = readdir($dossier))
  10. {
  11. if ($Fichier != "." AND $Fichier != ".." AND (stristr($Fichier,'.gif') OR stristr($Fichier,'.jpg') OR stristr($Fichier,'.png') OR stristr($Fichier,'.bmp')))
  12. {
  13. $h_vign = "120";
  14. $taille = getimagesize($nomRepertoire."/".$Fichier);
  15. $reduc = floor(($h_vign*100)/($taille[1]));
  16. $l_vign = floor(($taille[0]*$reduc)/100);
  17.  
  18. echo '<a target="_blank" href="', $urlphoto, '/',$Fichier, '">';
  19. echo '<img src="', $urlphoto, '/',$Fichier, '" ';
  20. echo "width='$l_vign' height='$h_vign'>";
  21. echo "</a>&nbsp;";
  22. }
  23. }
  24. closedir($dossier);
  25. }else{
  26. echo' Le répertoire spécifié n\'existe pas';
  27. }
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement