Jump to content

Any one know how to add a javascript setTimeout to a php include?


11Tami

Recommended Posts

Hello, does anyone know how to add a javascript setTimout to this? So that this include will re execute after so much time...Or is there a php refresh command I can add to this code itself, not the page.
Please let me know, thanks, Tami

<?php
include 'file.php';
?>
Anything that you might think of to try to accomplish this will not work in the way I am thinking you are wanting. Script execution is done line by line so maybe doing sleep() or usleep() might help you, but that will stop execution of the rest of the script until the sleep() or usleep() is done, the only way to allow for continuing and the execution to take place is maybe forking or threading in windows, but both of those will not allow the include to be really included into the current script process, so if your doing some back-end process it would be fine, but if you need function and variable scope from that include to be part of the current script process, then sleep() or usleep() would be the only way.

Thanks, I read up on those commands and I must be missing something. They sound like they stop the script after so many seconds is that correct?

Is there any php command to keep the script going or re-executing after so many seconds? It sure seems like there would be.

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.