Jump to content


Photo

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


  • Please log in to reply
1 reply to this topic

#1 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 12 September 2006 - 04:28 AM

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:

http://www.csscobalt.../upload_php.txt

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?

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 12 September 2006 - 06:15 AM

Save this as index.php in your uploads file:

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

Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users