setTimeout functionality in PHP ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jAY24
Forum Newbie
Posts: 2
Joined: Tue Mar 15, 2005 1:08 am

setTimeout functionality in PHP ???

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

read up on "cron" .. or the Windows equivalent: Scheduled Tasks.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

There are several cron solutions for Windows if you google... Probably more useful if on a Windows platform...
jAY24
Forum Newbie
Posts: 2
Joined: Tue Mar 15, 2005 1:08 am

Got it!!!

Post 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
Post Reply