noname_clark Posted November 11, 2008 Share Posted November 11, 2008 Hi, I have a very simple question, Is there a "pause" function in php. I don't want the wait. The wait function lets the page linger for x amounts of seconds.... Here is what I am trying to do: I have a Database called images, and it has a list of 560 images, and they are all numbered. I want to make a "slide show" where every 5 seconds it changes the image number (image number +1) and then gets the info for the next photo (from the database) Is there a way to do this in php? I can post the code if there is a way and maybe someone could help me change it so it works, but just searching around, I can not find it.... I know I can do it with Java Script, however I am much much better with php, and I would prefer to do it this way if possible. Just so you know, I am running PHP 4.6.(something) (i can get the actual number if you need it, however my server likes to change that number ever month or so [?]) any ideas? please? Link to comment https://forums.phpfreaks.com/topic/132247-do-something-pause-then-do-something-else/ Share on other sites More sharing options...
awpti Posted November 11, 2008 Share Posted November 11, 2008 You would still have to inform the client of the change, so no. This has to be done with some AJAX Magic. Link to comment https://forums.phpfreaks.com/topic/132247-do-something-pause-then-do-something-else/#findComment-687488 Share on other sites More sharing options...
noname_clark Posted November 11, 2008 Author Share Posted November 11, 2008 alright... thanks. I was really saving AJAX to learn this summer. I guess I'll give it a shot now! (and probably end up in a corner crying in about 3 hours... lol.) Link to comment https://forums.phpfreaks.com/topic/132247-do-something-pause-then-do-something-else/#findComment-687496 Share on other sites More sharing options...
BioBob Posted November 11, 2008 Share Posted November 11, 2008 Fast answer to your question, the function you are looking for is called SLEEP(); SLEEP(1); sleep for one second, etc. Another hopefully easy way might be to use META-REFRESH to direct to the next image, instead of php. PHP's disadvantage here is when it runs, it was pretty much designed to run a script and then end, not pause and wait in the middle of what it is doing. Waiting for user feedback is better suited for AJAX like awpti said, or javascript. Link to comment https://forums.phpfreaks.com/topic/132247-do-something-pause-then-do-something-else/#findComment-687619 Share on other sites More sharing options...
Mchl Posted November 11, 2008 Share Posted November 11, 2008 Ajax IS JavaScript Link to comment https://forums.phpfreaks.com/topic/132247-do-something-pause-then-do-something-else/#findComment-687627 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.