essjay_d12 Posted May 15, 2007 Share Posted May 15, 2007 I want to be able to read and then display files in php (files based within a folder within our web root folder), is there a way in which php can do this directly? They are going to be saved html pages and I want to be able to list them so users can view them. Cheers d Quote Link to comment https://forums.phpfreaks.com/topic/51478-accessing-folders-on-a-shared-network/ Share on other sites More sharing options...
clown[NOR] Posted May 15, 2007 Share Posted May 15, 2007 you want to look into - opendir() - readdir() Quote Link to comment https://forums.phpfreaks.com/topic/51478-accessing-folders-on-a-shared-network/#findComment-253497 Share on other sites More sharing options...
essjay_d12 Posted May 15, 2007 Author Share Posted May 15, 2007 i tried the folowing simple code... <?php $dir = "T:/webpages/main/"; // Open a known directory, and proceed to read its contents if (is_dir($dir)) { echo 'Exists'; } else { echo 'Unlucky'; } It constantly produces 'unlucky' for any dir path i give it ANyone know why? Quote Link to comment https://forums.phpfreaks.com/topic/51478-accessing-folders-on-a-shared-network/#findComment-253527 Share on other sites More sharing options...
Daniel0 Posted May 15, 2007 Share Posted May 15, 2007 Maybe it cached a wrong result? Try running clearstatcache() before it. Quote Link to comment https://forums.phpfreaks.com/topic/51478-accessing-folders-on-a-shared-network/#findComment-253532 Share on other sites More sharing options...
mjlogan Posted May 15, 2007 Share Posted May 15, 2007 If you are locally mapped to the webserver, is the drive actually called T:/ on the webserver itself? or is it T: on your machine and something else on the webserver. Quote Link to comment https://forums.phpfreaks.com/topic/51478-accessing-folders-on-a-shared-network/#findComment-253634 Share on other sites More sharing options...
clown[NOR] Posted May 15, 2007 Share Posted May 15, 2007 if it's on your computer and the php file is on a webserver i recomend you set up a ftp server and access it trough http://youip:port/path/goes/here think that should do the trick Quote Link to comment https://forums.phpfreaks.com/topic/51478-accessing-folders-on-a-shared-network/#findComment-253638 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.