Hallo PHP Forum,
ich habe seit Stunden das Problem, das der OnBeforeUnload Script einfach nicht ausgeführt wird.
ich habe seit Stunden das Problem, das der OnBeforeUnload Script einfach nicht ausgeführt wird.
Code:
<html> <head> <script language="JavaScript"> function offline() { <?php require_once("db_connect.php"); $username = $_SESSION["username"]; $online = "0"; mysql_query("UPDATE user SET online = '".$online."' WHERE username = '".$username."'"); ?> } </script> </head> <body onbeforeunload="offline()"> </body> </html>
Kommentar