Thread: readdir
View Single Post
Old Feb 17th, 2006, 1:07 PM   #3
anarki
Newbie
 
Join Date: Oct 2005
Posts: 5
Rep Power: 0 anarki is on a distinguished road
Hi Infinite recursion, thanx for the answer.
Unfortanly i dont understand your post correctly, my english is not the best and neither my code knowldge.

Here is a bit of my code:

$dirname = "/var/www/some/";
$dh = opendir($dirname);
while($file = readdir($dh)) {
if($file == '.' || $file == '..') {
continue;
}
else {
$oTemplate->newBlock('available');
$oTemplate->assign('template', $file);
$oTemplate->assign('fintable', "</table><table align='center'>");
$dirname2 = "/var/www/some/".$file;
$dh2 = opendir($dirname2);
while($file2 = readdir($dh2)) {
if($file2 == '.' || $file2 == '..') {
continue;
}
else {
$oTemplate->newBlock('name');
$name = $oDvd->idtoname($file2);
$oTemplate->assign('dvd', $name);

directories inside "some" are 1, 2, 3, 4.
Output in template is:

3, 2, 4, 1

I want:

1, 2, 3, 4

Maybe this can clear u something.

Thanx again.
anarki is offline   Reply With Quote