Page 1 of 1

Implement slide show with PHP

Posted: Fri Sep 17, 2004 1:58 pm
by ljCharlie
I have a photo gallery page that I want to implement a slideshow using PHP. All the file names and file locations are stored in a MySQL database. The picture will be displayed on the browser according to which section the user clicks. I already have a next and back button working for the user to move back and forth. The next thing I want to do is to have a radio button or a checkbox on the same page and when the user click this radio button, the picture will automatically move forward to the next picture exactly like the next button I already implemented. If I figure out a veriable that will hold the system's current time and compare that to the previous time to see if it is 5 seconds more, and if it is, increment the pictureID to the next pictureID so the next picture will load on the browswer.

Any help on this is grateful!

ljCharlie

Posted: Fri Sep 17, 2004 2:02 pm
by timvw
You're almost there, but need to get some things straight.

To generate a page request (thus coming from the client to the server) you can't use PHP (as it resides at the server side). You will probably need a JavaScript thingie to do that...

Posted: Fri Sep 17, 2004 2:23 pm
by ljCharlie
Yes, that is what I'm afraid the answer will. What about using a meta refresh to 5 seconds if the radio for auto display is pressed? Will this work?

ljCharlie

Posted: Fri Sep 17, 2004 2:34 pm
by ljCharlie
Okay, how about this. When the user click on the radio button for auto display, open another window and pass along all the information necessary to connect to the MySQL database and display the images in a slideshow manner. Will this work? And when the slideshow ended, close the window automatically.

ljCharlie

Posted: Fri Sep 17, 2004 2:37 pm
by feyd
using a radio button to activate it (unless only done once, before the slideshow starts) would require javascript.