Jump to content

do something, pause, then do something else?


noname_clark

Recommended Posts

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?

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.