Re: refresh for php/mysql chat
| From: | JJeffman | Date: | Sun, 07 Jan 2001 16:53:45 +0000 |
| Subject: | Re: refresh for php/mysql chat | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5678@lists.php.net to get a copy of this message | ||
As all the "chatting" happens on the server (php+mysql) your users only can
show the conversation if the page is reloaded, so no way to avoid reloading
the chat page, but you don't need to use meta-refresh tags, there is two
JavaScript functions that may be used instead,
"setInterval("my_function()",time);" and
"setTimeout("my_function()",time);"
both are methods of the window JavaScript object.
The function used as argument of the methods can call your php script to
reload the chat page. This way you can use an text type input tag to allow
the user configure how often the page must be reloaded and make it less
irritating .
HTH.
Jayme.
http://www.conex.com.br/jjeffman
-----Mensagem Original-----
De: sarahana <sarahana@cyberjunkie.com>
Para: <php-db@lists.php.net>
Enviada em: domingo, 7 de janeiro de 2001 04:49
Assunto: [PHP-DB] refresh for php/mysql chat
> Hi,
> I wrote a chat using php/mysql.. and everything is working fine, except
that
> I despise the meta auto-refresh - its really irritating :-)
>
> So I was wondering if anyone of you are aware of an alternative - if you
do,
> please do help me out.
>
> Also, to show the users online, I simply do a "select" retrieve from the
> users table, and I delete an entry if the user logs out. But what if the
> user does not log out and simply closes the window - what have you done /
or
> would do to delete the entry from the table? Is there a way to check all
the
> cookies (I'm using cookie for login) and see if there is a certain value
of
> the cookie that does not exist? If I could do that, then I could delete
the
> entry...
>
>
> Thanks,
> sarahana
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>