Instructables

How do i list folder contents in php?

I have a folder that i would like to upload files, edit files, and delete files on,  i would liek this done in php, and the folder that is being edited maches the name of the person logged in
"
session_register("myusername");
"  How do i do this?

phpkode4 years ago
It's very easy.  Here is a great example:

http://www.liamdelahunty.com/tips/php_list_a_directory.php

Oh, and if you're looking to do more like editing / deleting, etc. You should grab one of the many open source PHP file managers out there:

http://www.hotscripts.com/category/php/scripts-programs/file-manipulation/file-management/


Just be careful on security.  Web-based file management apps require you to make directories read/write and that could easily open your site up to hackers if not properly secured.
NachoMahma4 years ago
.  PHP.net - for all thing PHP
http://php.net/manual/en/function.readdir.php
Re-design4 years ago
If you joined a forum specifically php related you could get all of your questions answer expertly.