Basic PHP File Browser with download capability

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rapier_gv
Forum Newbie
Posts: 1
Joined: Sat May 05, 2007 7:42 am

Basic PHP File Browser with download capability

Post by rapier_gv »

first of all, hello everybody, as you can see i'm new here so you gotta be extra nice to me! :lol:

i'm not quite the php guru but i need the following thing for my next project: as the title says, i want to build my very own php file browser, which does a very basic listing of a predefined folder. below is my code this far:

Code: Select all

if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            echo "$file<br />\n";
			
		}
    }
    closedir($handle);
}
what i want and don't know how to do is showing a nice little checkbox before every listed file and a download button to.. well, obviously download the chosen files.

i know this is kind of a noobish question, thanks in advance for any help or suggestions whatsoever!
Post Reply