connection_status()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Griffiths

    connection_status()

    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
  • Chung Leong

    #2
    Re: connection_stat us()

    Try register_shutdo wn_function('lo gout');

    junk2.jamesgrif f@ntlworld.com (James Griffiths) wrote in message news:<8b3c2aa1. 0311301334.91ac aad@posting.goo gle.com>...[color=blue]
    > 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[/color]

    Comment

    Working...