Implement slide show with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Implement slide show with PHP

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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...
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post 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
ljCharlie
Forum Contributor
Posts: 289
Joined: Wed May 19, 2004 8:23 am

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

using a radio button to activate it (unless only done once, before the slideshow starts) would require javascript.
Post Reply