Infected.Shadow Posted December 7, 2009 Share Posted December 7, 2009 For some reason when this script runs, the main directory is listed correctly. All the folders are marked as directories. But when I go down to one of those directories, the directories in that folder are seen as files. Why is this happening on subfolders? case 'direc': $current_dir = $_GET['dir']; $dir = opendir($current_dir); echo '<strong>CURRENTLY BORWSING:</strong> '.$current_dir.'<br /><hr />'; while($file = readdir($dir)) { if(is_dir($file)) { echo '[DIR] <a href="'.$_SERVER['PHP_SELF'].'?mode=direc&dir='.$file.'">'.$file.'</a><br />'; } } $dir = opendir($current_dir); while($file = readdir($dir)) { if(!is_dir($file)) { $f = $file; $f = explode('.', $f); $filename = $f[0]; $filetype = $f[1]; echo '- <a href="'.$_SERVER['PHP_SELF'].'?mode=ss&filename='.$filename.'&filetype='.$filetype.'&fdir='.$current_dir.'">'.$file.'</a><br />'; } } break; Link to comment https://forums.phpfreaks.com/topic/184290-is_dir-seeing-directories-as-files/ Share on other sites More sharing options...
Infected.Shadow Posted December 8, 2009 Author Share Posted December 8, 2009 Shameless bump from page 3 >_>; Link to comment https://forums.phpfreaks.com/topic/184290-is_dir-seeing-directories-as-files/#findComment-973246 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.