conker87 Posted March 19, 2007 Share Posted March 19, 2007 I've made half of the code for a little "hosting" site for a few of the members of my site. Their files are uploaded to /login/<username>/ I'm now stuck as to how to show the contents of the folder in a page. I think the use of fopen() is needed, however the php website is a little confusing. Any advise/examples/etc? Link to comment https://forums.phpfreaks.com/topic/43403-getting-contents-of-folder/ Share on other sites More sharing options...
bwochinski Posted March 19, 2007 Share Posted March 19, 2007 For a simple listing, you can try scandir() Link to comment https://forums.phpfreaks.com/topic/43403-getting-contents-of-folder/#findComment-210806 Share on other sites More sharing options...
conker87 Posted March 19, 2007 Author Share Posted March 19, 2007 Hmm. Well, that wont work, apparently I'm only running PHP 4. I cant upgrade for numerous reasons. Thanks though. Any other suggestions? Link to comment https://forums.phpfreaks.com/topic/43403-getting-contents-of-folder/#findComment-210812 Share on other sites More sharing options...
bwochinski Posted March 19, 2007 Share Posted March 19, 2007 ok then... you can check out dir(). They have a small example on that page. You could return the list to an array for further sorting. Link to comment https://forums.phpfreaks.com/topic/43403-getting-contents-of-folder/#findComment-210816 Share on other sites More sharing options...
jcbarr Posted March 20, 2007 Share Posted March 20, 2007 search php.net for scandir() they have several php 4 compliant workarounds listed on the same page. I use one currently but don't have access to the file to show you right now. Link to comment https://forums.phpfreaks.com/topic/43403-getting-contents-of-folder/#findComment-210855 Share on other sites More sharing options...
AndyB Posted March 20, 2007 Share Posted March 20, 2007 or glob() - http://ca3.php.net/manual/en/function.glob.php - offers some extra selectivity Link to comment https://forums.phpfreaks.com/topic/43403-getting-contents-of-folder/#findComment-210886 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.