jimbowvu80s Posted December 30, 2010 Share Posted December 30, 2010 Is it possbile to use PHP to list directories outside of the root of the web server - for example c:\images or d:\images? I can use this script to list the files from the root down, but when I change the path to look at something outside the web server directory I get zero results back. Thank you. <?php filesInDir('d:\policy'); function filesInDir($tdir) { echo ("<p><h1>List of files in ($tdir):</h1></p><hr><br />"); $dirs = scandir($tdir); foreach($dirs as $file) { if (($file == '.')||($file == '..')) { } elseif (is_dir($tdir.'/'.$file)) { filesInDir($tdir.'/'.$file); } else { echo $tdir.'/'.$file.' --- '.date("F d Y H:i:s", filemtime('$file'))."<br>"; } } } ?> Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted December 30, 2010 Share Posted December 30, 2010 depends on server config. apparently your server is config'ed so it's not possible. Quote Link to comment Share on other sites More sharing options...
jimbowvu80s Posted December 30, 2010 Author Share Posted December 30, 2010 Are you refering to the PHP.ini file or the web.config file? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.