javascript/php problem on browser close/unload event
Posted: Tue Aug 24, 2010 4:38 pm
i am trying to set user status as offline when user close browser but i am facing a problem ...
i am calling a function when body unload which will set guest user status to "0" when user close the browser but it not working ...
it execute php before function is called..
any idea why this is happening ...plz help it's making me crazy
i am calling a function when body unload which will set guest user status to "0" when user close the browser but it not working ...
it execute php before function is called..
any idea why this is happening ...plz help it's making me crazy
Code: Select all
function hello()
{
<?php
$Gueststatus="update tbl_guestuser set STATUS='0' Where USERNAME='$userG'";
mysql_query($Gueststatus);
$Userstatus="update tbl_signup set loginststus='0' Where MemberUserName='$user'";
mysql_query($Userstatus);
?>
alert('using');
}