hellonoko Posted October 17, 2008 Share Posted October 17, 2008 When I take out the if (is_dir) statment in this code it echo's the directories. When I put it in to check if they are directories it only display . and .. <?php $users_directory = "/home2/sharingi/public_html/subdomains"; if ($dir_handle = opendir($users_directory)) { while (false !== ($file = readdir($dir_handle))) { if( is_dir($file) ) { echo $file; echo "<br>"; } } } closedir($dir_handle); ?> Link to comment https://forums.phpfreaks.com/topic/128788-solved-simple-list-directories-script-failing/ Share on other sites More sharing options...
corbin Posted October 17, 2008 Share Posted October 17, 2008 This is a long shot, but try: if( is_dir($users_directory . '/' . $file) ) Link to comment https://forums.phpfreaks.com/topic/128788-solved-simple-list-directories-script-failing/#findComment-667726 Share on other sites More sharing options...
ghostdog74 Posted October 17, 2008 Share Posted October 17, 2008 it works fine for me. Link to comment https://forums.phpfreaks.com/topic/128788-solved-simple-list-directories-script-failing/#findComment-667729 Share on other sites More sharing options...
hellonoko Posted October 17, 2008 Author Share Posted October 17, 2008 Corbin Thanks! Works. Must be something to do with my host. Link to comment https://forums.phpfreaks.com/topic/128788-solved-simple-list-directories-script-failing/#findComment-667739 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.