I am new in web development but I have worked with html and php as far as web development but I haven’t built an entire website for commercial use. I only worked with html and php while I was in school for projects.
By the way I am in grad school, with not much experience.
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 have a single html page with either a link as text or a button to navigate to the next and another button for 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 any way to write code that read all the name of pictures 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.
What is your goal? Is it to learn web development or to create a website that you can show off some pictures on?
If it’s the latter, then I would recommend just setting up a wordpress site and installing a photo gallery plugin.
If you want to do everything yourself, then I would use some javascript library like lightbox (there are many more that are similar) on your current site. Store the image info in a mySql database, pull the image paths through to the site using PHP, and then use the js library of your choice so you aren’t re-inventing the wheel when it comes to the actual functionality of the gallery.