Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Posts
    185
    Thanks
    2
    Thanked 1 Time in 1 Post

    generating html files from image files in a directory

    hi. my mom wants a site where she and other family members (in other states) can upload images of events, distant relations, etc. with comments, and some kind of search and/or sort functionality. i suspect this is probably an application that asp or php would be best suited for - but i really just can't afford to spend the kind of time learning one of those would require. i'm trying to come up with a simple, quick method and all i'm coming up with is something like an html form with upload dialogue, user picks a directory from list. (i think i got this part covered). after that, many questions arise:

    is it possible for js to create a new document (a .html file)? as far as i know, only server-side languages can do this, but i really have no idea... any direction here would be helpful, but if possible it would be great to have onsubmit, a js function to create (duplicate?) an .html file with precanned code (just html, body, and img tags) with the src of the img set to the filename of the jpg that was just uploaded. if not, maybe i could pregenerate a thousand .html files and have javascript rename them and change the one line of img src?

    then finally, a function that creates an array of all the files in each of those user-accessible directories and makes a link for each, maybe somethig like:
    Code:
          txtOutput += '<a href="'+filename+' + '.html'">'+filename+'<a>';
          document.getElementById('somefiles').innerHTML = txtOutput;
    but i don't even know how to really apply that and i suspect i'm making that part more difficult than it needs to be...

    so.. any suggestions at all, or scraps of script, or links to a precanned solution, whatever, is helpful since ive got nothin goin. i did try a couple php message boards (where i've seen folks upload images, thought maybe i could adapt it), but had no luck when trying to install them serverside...

    tyia

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'd go back to PHP w/MySQL db, using PHPmyAdmin.

    There are lots of free canned scripts available for doing what you want.


    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Posts
    185
    Thanks
    2
    Thanked 1 Time in 1 Post
    james,
    thx for the reply... can you (or anyone) point me in the right direction? a link would be terrific... and once i've got the code, what needs to happen serverside? last failed attempt returned server-generated errors of "your database selection doesn't match the configuration on your server" or "cannot open (connect?) to database" - i tried with a msaccess.php, mysql.php for 3 and 4, and nothing caught... anything about permissions, directory structure, etc et al i should know?

    thx again.


  •  

    Posting Permissions

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