#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    1
    Rep Power
    0

    Post New user - what is the best way to create web gallery


    Hello Everyone,

    I am a computer scientist who worked with html and php as far as web development but I have never built an entire website.

    I just graduated from college so my experience is not much.

    Now here is the thing, I want to create a web page to represent my photographs and designs and I faced the following problem:
    I want to create a single html page with either link as text or button to navigate to the next and previous picture.

    When it came to the point of changing the picture, I created a javascript to switch to a particular picture but this is not quite what I want, I would like it to be dynamic, meaning, is there a way to read all the names of picture in the server where my website will reside and then put them in an array or something then loop through them forward and backward.

    I know that javascript is for the user side and php is for the server side, also I know it's not a good idea to let javascript access directory the way I described.

    So I just need some help or ideas to accomplish this task the proper way.

    Thanks in advance.
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Location
    Jakarta, Indonesia.
    Posts
    218
    Rep Power
    32
    As far as I know, JS couldn't possibly tell what image files reside inside a gallery directory, without a help from PHP. And if you're using this (ajax) scenario, I don't see any security dangers in that.

    But why don't you just let PHP create your previous, and next links/ buttons. Current image state would be passed through a GET form, or though cookies. No JS is required, and it's simpler I guess.

    Hendra
    Last edited by hdewantara; July 3rd, 2012 at 02:48 AM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Location
    USA
    Posts
    33
    Rep Power
    0
    I use smugmug.com and post to galleries directly. I find it very simple and intuitive.

IMN logo majestic logo threadwatch logo seochat tools logo