madspof Posted September 3, 2006 Share Posted September 3, 2006 i am looking for a script that will list sub folders and give them a link Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/ Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 Do you also want nested subfolders? Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85142 Share on other sites More sharing options...
madspof Posted September 3, 2006 Author Share Posted September 3, 2006 sorry i am quite a newbie but i am learning what are nested subfolders ? Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85145 Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 folders inside folders inside folders ....... Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85154 Share on other sites More sharing options...
madspof Posted September 3, 2006 Author Share Posted September 3, 2006 it does'nt have to be nested what ever is easier for you tho i would prefer nested Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85157 Share on other sites More sharing options...
madspof Posted September 3, 2006 Author Share Posted September 3, 2006 it does'nt have to be nested what ever is easier for you tho i would prefer nested Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85168 Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 This will list folders and their nested subfolders[code]<?phpfunction listSubFolders ($dir, $level=0) { if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_dir("$dir/$file")) { $indent = str_repeat('---', $level); echo "$indent $file<br>"; listSubFolders("$dir/$file", $level+1); // list subfolders of this folder } } } closedir($handle); }}$dir = 'c:/inetpub/wwwroot'; // <-- specify folderlistSubFolders($dir);?>[/code] Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85173 Share on other sites More sharing options...
madspof Posted September 3, 2006 Author Share Posted September 3, 2006 this is very good but i cannot see a way of the script being able to make a link to the folders Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85175 Share on other sites More sharing options...
Barand Posted September 3, 2006 Share Posted September 3, 2006 Add [code]<a href='.....'>...........</a>[/code] tags.Thought I'd leave you something to do. Link to comment https://forums.phpfreaks.com/topic/19574-php-subfolder-listing/#findComment-85176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.