<?
function getDirList_un ($dirName) {
$count = 0;
$d = dir($dirName);
$array = array();
while($entry = $d->read()) {
if ($entry != "." && $entry != ".." && $entry != "index.php") {
if (is_dir($dirName."/".$entry)) {
} else {
$array[$count] = $entry;
$count++;
}
}
}
$y = sizeof($array);
while ($y != -1){
include $array[$y];
$y--;
}
$d->close();
}
getDirList_un("/var/www/html/meepokman/ver02/0804/");
?>
Basically, what this script does is to return the filenames in a folder and pass it into an array.
I then use the while loop to return it into the page in the reverse order.
To include all the files, i use the include function in the while loop.
But I have an error when doing this.
Warning: Failed opening '' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/meepokman/ver02/0804/index.php on line 18
When i don't use the include but just echo, there is no error. The error only appears when i use include.
Please advise. Thanks!