Dear all,
My spec:
Win 98
Apache 2.0.46
PHP 4.3.2
I am making a chat program which needs to log out the user if they
close the window or press 'Stop'.
I used the following code:
set_time_limit( 0);
ignore_user_abo rt(TRUE);
while(1) {
if (connection_sta tus()) {
logout();
}
}
where logout() is a function.
This had no effect, apparently because i needed to send data to the
client to be able to tell whether the connection was still active. So
I used the following code:
set_time_limit( 0);
ignore_user_abo rt(TRUE);
while(1) {
echo "\n";
flush();
if (connection_sta tus()) {
logout();
}
}
This, however, died when I pressed 'Stop'.
Anyone have any bright ideas?
Regards,
James
My spec:
Win 98
Apache 2.0.46
PHP 4.3.2
I am making a chat program which needs to log out the user if they
close the window or press 'Stop'.
I used the following code:
set_time_limit( 0);
ignore_user_abo rt(TRUE);
while(1) {
if (connection_sta tus()) {
logout();
}
}
where logout() is a function.
This had no effect, apparently because i needed to send data to the
client to be able to tell whether the connection was still active. So
I used the following code:
set_time_limit( 0);
ignore_user_abo rt(TRUE);
while(1) {
echo "\n";
flush();
if (connection_sta tus()) {
logout();
}
}
This, however, died when I pressed 'Stop'.
Anyone have any bright ideas?
Regards,
James
Comment