Dejo el codigo y el resultado que me da cuando listo el directorio que lo contiene.
Código PHP:
$dir = dirname(_FILE_)."/images/";
if (is_dir($dir)) {
if ($gd = opendir($dir)) {
while (($archivo = readdir($gd)) !== false) {
if ( filetype($dir . $archivo) != "file") {
echo "nombre de archivo: $archivo : tipo de archivo: " . filetype($dir . $archivo) . "<br>";
}
}
closedir($gd);
}
}
Código:
Los directorios a los que necesito acceder son al images/temporal y images/produccion y aunque desde el ftp los veo, al listar el directorio images no les encuentra tipo. Notice: Use of undefined constant _FILE_ - assumed '_FILE_' in /var/www/vhosts/cfired-negocios.org.ar/httpdocs/logo.php on line 82 nombre de archivo: . : tipo de archivo: dir nombre de archivo: .. : tipo de archivo: dir Warning: filetype(): open_basedir restriction in effect. File(./images/temporal) is not within the allowed path(s): (/var/www/vhosts/cfired-negocios.org.ar/httpdocs:/tmp) in /var/www/vhosts/cfired-negocios.org.ar/httpdocs/logo.php on line 86 Warning: filetype(): open_basedir restriction in effect. File(./images/temporal) is not within the allowed path(s): (/var/www/vhosts/cfired-negocios.org.ar/httpdocs:/tmp) in /var/www/vhosts/cfired-negocios.org.ar/httpdocs/logo.php on line 87 nombre de archivo: temporal : tipo de archivo: Warning: filetype(): open_basedir restriction in effect. File(./images/produccion) is not within the allowed path(s): (/var/www/vhosts/cfired-negocios.org.ar/httpdocs:/tmp) in /var/www/vhosts/cfired-negocios.org.ar/httpdocs/logo.php on line 86 Warning: filetype(): open_basedir restriction in effect. File(./images/produccion) is not within the allowed path(s): (/var/www/vhosts/cfired-negocios.org.ar/httpdocs:/tmp) in /var/www/vhosts/cfired-negocios.org.ar/httpdocs/logo.php on line 87 nombre de archivo: produccion : tipo de archivo: nombre de archivo: bienvenidos 150x43 : tipo de archivo: dir