Jump to content

Archived

This topic is now archived and is closed to further replies.

JustinMs66@hotmail.com

Showing the uploaded Files using a index.php in Uploads directory. PLZ HELP ME!

Recommended Posts

i have a upload script, and i wana have a "index.php" INSIDE the "uploads/" directory that shows the files, but in an organized manner, and has links on the files, To the files. here is my current upload script:

[url=http://www.csscobalt.com/uploads/upload_php.txt]http://www.csscobalt.com/uploads/upload_php.txt[/url]

and what i was thinking, was that somehow, instead of listing the files in the Dir, every time something is uploaded, it simply adds the upload to the index.php file. but i don't even know where to begin.

any help?

Share this post


Link to post
Share on other sites
Save this as index.php in your uploads file:

[code]<?php
foreach (glob("*.*") as $filename) {
    if ($filename!="index.php") {
        echo "<a href='". $filename. "'>". $filename. "</a><br/>";
    }
}
?>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.