18-02-2011, 09:22 AM
(Modification du message : 18-02-2011, 11:17 AM par Sephi-Chan.)
Bonjour à tous.
J'ai trouvé la réponse ici :
http://www.php.net/manual/fr/function.co...status.php
I was building a chat and I wanted my script to detect when the browser was closed, so the user could be deleted from the online_users table.
J'espère que ça peut vous aider.
Bonne journée
J'ai trouvé la réponse ici :
http://www.php.net/manual/fr/function.co...status.php
I was building a chat and I wanted my script to detect when the browser was closed, so the user could be deleted from the online_users table.
echo str_repeat(" ",300);
ignore_user_abort(true); //this way, the user can stop the output, but not the script.
while (true) {
echo "test<br>\n";
flush();
sleep(2);
if (connection_status()!=0){
include ('dbconnect.inc');
$sql="delete from online_users where online_user=$user";
$sql_exec=pg_exec($vChatDB, $sql);
die(); //kills the script
}
}
J'espère que ça peut vous aider.
Bonne journée