Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/11/2003, 03:52
Avatar de ProgramacionWeb
ProgramacionWeb
 
Fecha de Ingreso: junio-2003
Ubicación: Barcelona
Mensajes: 176
Antigüedad: 20 años, 10 meses
Puntos: 2
Para listar los harchivos de un directório:
Código PHP:
<? 
$dir 
opendir("."); 
while (
$file readdir($dir)) { 
    echo 
"<a href=\"$file\"><img src=\"thumb.php?ruta=$file&ancho=30&alto=30\"</a><br>"

closedir($dir); 
?>
Luego para hacer el thumbnail (thumb.php):
Código PHP:
<?php 
$fuente 
= @imagecreatefromgif($ruta); 
$imgAncho imagesx ($fuente); 
$imgAlto =imagesy($fuente); 
$imagen ImageCreate($ancho,$alto); 

ImageCopyResized($imagen,$fuente,0,0,0,0,$ancho,$alto,$imgAncho,$imgAlto); 

Header("Content-type: image/gif"); 
imageGif($imagen); 

?>
__________________
Foros en los que participo: