Page 1 of 1

setTimeout functionality in PHP ???

Posted: Tue Mar 15, 2005 1:15 am
by jAY24
Hi All,

I have been looking for an solution for this for couple of days, but till now no success.

OS : Windows 2000 Server.
DB : MySQL
PHP : 4.3.4

Is there any function or examples script that can emulate the same functionality as JavaScripts setTimeout() function.

What I need to do is as follows :

Execute an PHP script at predefined intervals...

In my web site, I have registered users logging in. I need to track and store the time they spend on the site using sessions. So for doing this, I need to run an PHP script every 1 minute in the background and log the time and store it in MySQL DB. This has to be done without the user's knowledge and so the page cannot be reloaded or refreshed.

Help is greatly appreciated. Thank You.

Regards,

jAY

Posted: Tue Mar 15, 2005 1:27 am
by feyd
read up on "cron" .. or the Windows equivalent: Scheduled Tasks.

Posted: Tue Mar 15, 2005 7:36 am
by Maugrim_The_Reaper
There are several cron solutions for Windows if you google... Probably more useful if on a Windows platform...

Got it!!!

Posted: Tue Mar 15, 2005 7:44 am
by jAY24
Hi all,

I found this.. Java Script Remote Scripting
http://www.ashleyit.com/rs/jsrs/test.htm

"make asynchronous remote calls to server without client page refresh"

Hope it helps someone some day...

This has been what I have been looking for...

Thank You..

jAY