Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hey guys, its been a while ince I have needed to post but am back for some help.
I have a folder with x number of directories. I have no problem displaying these its the layer after that. ie. the directories in the first directories.
[syntax="php"]
$rep=opendir('.');//opens initial layer
while ($file = readdir($rep)){//while loops the directories
if($file != '..' && $file !='.' && $file !=''){
if(is_dir($file)){ //then if $file is a dir
$sub = opendir("$file"); //it opens that dir
while ($subf = readdir("$sub/")){//its having a massive prob with this, basically I dont know what to ref
if($subf != '..' && $subf !='.' && $subf !=''){//its then meant to check the sub folder for files
if (is_dir("$rep/$subf")){
print("<tr><td> </td>");
print("<td width='100%'>");
print("<a href='$subf/' target=_blank>$subf</a>");
print("</td></tr>");
}
}
}
}
}}Thanks for any help
Andylyon87
pickle | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]