You know with PHP and MySQL, you can list a load of data. Well, is it possible to do it with just PHP and a folder.
I need to list the items from a folder basicly, should I make a Database and store the data there?
This is a discussion on List Folder Contents within the PHP, ASP, JavaScript, Etc. / Programmers: forums, part of the Web Project Requests: category; You know with PHP and MySQL, you can list a load of data. Well, is it possible to do it ...
You know with PHP and MySQL, you can list a load of data. Well, is it possible to do it with just PHP and a folder.
I need to list the items from a folder basicly, should I make a Database and store the data there?
There are commands to read a directory in PHP...
$dirname='/home/dir-to-read';
if ($handle = opendir($dirname)) {
while (false !== ($filename = readdir($handle))) {
echo($filename."\n");
}
closedir($handle);
}
Would load and print a list on the page. Of course you'd probably want to do some formatting rather than just an echo. You can put whatever code you want there.
Last edited by sunken; 04-03-2008 at 09:47 PM.
Bookmarks