Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/06/2011, 13:32
tsueseres
 
Fecha de Ingreso: mayo-2011
Mensajes: 53
Antigüedad: 13 años
Puntos: 0
Respuesta: como obtener la direccion de todos los archivos en un directorio

Cita:
Iniciado por repara2 Ver Mensaje
Código PHP:
Ver original
  1. <?
  2. $the_array = Array();
  3. $url = $_SERVER['SERVER_NAME'];
  4. $handle = opendir('/tmp');
  5. while (false !== ($file = readdir($handle))) {
  6.    if ($file != "." && $file != "..") {
  7.    $the_array[] = $file;
  8.    }
  9. }
  10. closedir($handle);
  11. sort ($the_array);
  12. foreach($the_array as $val){
  13.    echo "<a href=\"$url/$val\">$val</a><br>";
  14. }
  15. ?>
Puedes utilizar el array $_SERVER para acceder a este tipo de información, a ver si sirve, saludos
gracias