Posted 28 July 2006 - 12:26 PM
In script terms, I want a user to be able to submit a form at any time and it then delays the processing script until a specific amount of seconds/minutes/hours/days has passed.
During this delay period, the user should be able to navigate the site, logout, go on holiday, whatever, without breaking the script.
So, I thought about making it so when you submit the form, it sends the details to a server background script or summat, and then, even if you're not viewing the script, once the time passes, the script activates.
Sounds well and good... but... How do I do it??? Some said Cron job, but I highly doubt i'd be able to Cron job a script saying "If ($timecompletion > time()) then..." to run every second of the day...
Posted 28 July 2006 - 12:53 PM
Keep in mind that once the href is changed, there can be another delay for the page to actually load in the window. During that time, if the user clicks a link, the href change request will be aborted. This behavior can be seen when you click one link on a page and before it changes you can click a different link and load that instead. To avoid this problem, you could use document.write() to erase the contents of the visible frame pending loading of your page.
Finally, behavior of the back and forward browser buttons can vary with different browsers. I believe that most of the browsers out there will go back and forward within frames, which would work fine with the solutions presented.
Posted 28 July 2006 - 03:02 PM
- If the user shutdown his computer, will the countdown until execution still occur on the server?
- How would you get it to work so even if you logged onto another computer, then the countdown would still be going?
Posted 28 July 2006 - 03:33 PM
As for the second question, I'm not exactly sure what you're looking to do. One option might be to record the time of request in a database. When the user logs onto another computer, the time is gotten from the database, compared to the current time, and then the necessary delay time can be figured.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users