Results 1 to 4 of 4

Thread: Directory contents to array

  1. #1
    Join Date
    Dec 2007
    Location
    612 Warf Ave
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Directory contents to array

    I'm kinda new to web development so I still have a lot to learn. Hopefully someone can help me out here.
    I'm trying to create a personal family page where I can share pictures with friends and family. I can hand code the pages with all the images, but that would take too long to do whenever I want to add new images or album.
    What I'm looking for is a way to use Javascript to pull in the contents of a directory (in this case it would be all images) into an array so that I can just have the HTML created dynamically using the contents of the array. Hopefully I'm asking the question right. Any help?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You'd most likely need a server-side script to produce this array.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Dec 2007
    Location
    612 Warf Ave
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks. Actually, that makes more sense. I'm a little bit of a newb at Perl and Bash too but I can probably do it. Any leads?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    PHP is the most popular method, and if it is available on your server, you could use this combination of PHP and javascript:

    http://www.dynamicdrive.com/dynamici...photoalbum.htm

    There are many other possible approaches, some using only server side code, which would have the advantage of not requiring javascript on the user's end. But, any such gallery would be a little less elaborate.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •