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?

phpkode3 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.
NachoMahma3 years ago
.  PHP.net - for all thing PHP
http://php.net/manual/en/function.readdir.php
Re-design3 years ago
If you joined a forum specifically php related you could get all of your questions answer expertly.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!