run a function in a two minuts interval

elic05

Member
Joined
Nov 2, 2008
Messages
19
Programming Experience
Beginner
i want to check from time to time the data in a db
is there an option like setInterval of javascript?
 
Javascript does have a timer object: JavaScript Timing Events

You can set it up to make a DB call (Ajax style) to refresh the part(s) of the page you need it to or you can have it simply submit a postback to the server and the returned page could have the updated data on it.
 
i dont want it to run from the client
it has to run on the server

i want to check if a user didnt post to the server for a few minutes
i want him to be removed from a list of user that i have in my db
 
Last I knew with web technology there's no way for the server to force a postback on the client, it's always the client that needs to postback to the server, which means you'll need something on the client that'll know when to get new data from the server. With Ajax it's easy to make the small request and update only a part of the page (instead of the whole thing) like how Facebook and Gmail works.

You could have it set up so that after so long of inactivity the client (again Ajax) makes a request to the server that logs them out.
 
Back
Top