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';
?>
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.