Timer or Timeout??? How cam I do that?
Posted: Mon Jul 07, 2003 11:21 pm
How can I do timer in PHP (meaning that after time is up, it will execute some function)
PS: In java I did this as:
PS2: Yes, that JavaScript + PHP
Code: Select all
setTimeout('time_out()','120000')
function time_out(){
<?
//Setting user status to OffLine
$db = mysql_connect("localhost","root", "");
mysql_select_db("test", $db);
$sql = "UPDATE users SET status='OffLine' where u_name='$u_name'";
mysql_query($sql);
?>
//window.document.write("<b>OffLine</b>");
}