The Little Guy Posted December 31, 2006 Share Posted December 31, 2006 Why does this work:[code]<?php$dir = $_SERVER['DOCUMENT_ROOT'].'/tzfiles';$files = scandir($dir, 1);foreach($files as $file){ if(is_dir($file) && $file != '.' && $file != '..'){ echo '<strong class="bigger">'.$file.'</strong>'; }}?>[/code]But this doesn't:[code]<?php$dir = $_SERVER['DOCUMENT_ROOT'].'/tzfiles/users/'.$_SESSION['user'];$files = scandir($dir, 1);foreach($files as $file){ if(is_dir($file) && $file != '.' && $file != '..'){ echo '<strong class="bigger">'.$file.'</strong>'; }}?>[/code]The first line of both pieces code is where the only differences are. Link to comment https://forums.phpfreaks.com/topic/32417-scandir/ Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 Uh... maybe you didn't make the folder with the right permissions? Link to comment https://forums.phpfreaks.com/topic/32417-scandir/#findComment-150580 Share on other sites More sharing options...
The Little Guy Posted January 1, 2007 Author Share Posted January 1, 2007 But... it is all on my hard drive, local computer and not a remote server. Link to comment https://forums.phpfreaks.com/topic/32417-scandir/#findComment-150718 Share on other sites More sharing options...
phrozenflame Posted January 1, 2007 Share Posted January 1, 2007 You might need to CHmod your folder permissions Link to comment https://forums.phpfreaks.com/topic/32417-scandir/#findComment-150730 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.