Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PHP Chat REALTIME

9 views
Skip to first unread message

David

unread,
Jan 22, 2002, 6:43:49 AM1/22/02
to php-g...@lists.php.net
hey, i thought about this problem last time, i figured out that there's NO WAY to do this in php, (the auto refresh does not count). somebody pls prove me wrong.

intrested to continue this discussion

David
>I need to build a php-chat (online support system), but in >realtime.
>I've develope a system that refresh in browser client in 5 >seconds. But i need a system that works in realtime, what >i meen is when a client or the server send a message, the >browser refresh when a message was sent.
>All this without JAVA.

Nuno Mariz

unread,
Jan 22, 2002, 5:32:26 AM1/22/02
to php-g...@lists.php.net
I need to build a php-chat (online support system), but in realtime.
I've develope a system that refresh in browser client in 5 seconds. But
i need a system that works in realtime, what i meen is when a client or
the server send a message, the browser refresh when a message was sent.
All this without JAVA.

thanx

Ben-Nes Michael

unread,
Jan 22, 2002, 5:51:00 AM1/22/02
to Nuno Mariz, php-g...@lists.php.net
The server can controll the Refresh and the cache expiry through headers
sent when the page is requested by the client.

add this to expire client content every time a request for the same page is
sent.
header("Pragma: no-cache");

add this to refresh client content every 5 sec
<meta http-equiv="Refresh"
content="5;URL=http://www.doamin.com/page.phtml">.

--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--------------------------

> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general...@lists.php.net
> For additional commands, e-mail: php-gene...@lists.php.net
> To contact the list administrators, e-mail: php-lis...@lists.php.net
>
>

Joel Boonstra

unread,
Jan 22, 2002, 11:10:34 AM1/22/02
to Nuno Mariz, php-g...@lists.php.net

Have you thought about using a pre-built system:

http://www.phplivesupport.com/web/phplive_web/

It does cost money (one-time fee, no recurring fee), but I would imagine
that spending time to build one yourself would also cost money (in terms
of time).

I have never used it, but it definitely looks to be worthwhile.

--
[ joel boonstra | jboo...@gospelcom.net ]

Emile Bosch

unread,
Jan 22, 2002, 10:59:01 AM1/22/02
to php-g...@lists.php.net
it's kinda impossible since HTTP is a STATELESS PROTOCOL


"Nuno Mariz" <nma...@websolut.net> wrote in message
news:1011695546.3467.5.camel@sputnik...

Joffrey Van Wageningen

unread,
Jan 22, 2002, 10:35:06 AM1/22/02
to php-g...@lists.php.net, James Cox
> i haven't been following this, but have you guys thought of ircg?
> http://php.net/ircg

ircg is a lot of fun and could be used as the server system for message
management, the real problem is how to get the data to the client without
use of a socket

ircg also needs an ircd which is a little to bloated[1] for a simple
solution for a realtime chat :)

/me is taking a extra jolt on ircg :)

Joffrey van Wageningen
ne2000.nl
--
[1]
bloat·ed (bltd)
adj.
1.. Much bigger than desired: a bloated bureaucracy; a bloated budget.
2.. Medicine. Swollen or distended beyond normal size by fluid or gaseous
material.

Fredrik Wahlberg

unread,
Jan 23, 2002, 10:54:50 AM1/23/02
to php-g...@lists.php.net
If you don't close the connection with the client you can use flush() to
send accumulated data.

Exampel:
Start the webpage
flush() // sends initial data

while (conversation in progress) {
if (newdata found) {
echo "newdata";
flush();
}
sleep(a while);
}

end page

--
----------------------------------------
Fredrik Wahlberg W: +46-8-54 54 56 12
Fusage AB C: +46-70-576 16 51
Kungstensgatan 38A F: +46-8-54 54 56 10
113 59 Stockholm fre...@fusage.com
Sweden

"Nuno Mariz" <nma...@websolut.net> wrote in message
news:1011695546.3467.5.camel@sputnik...

Andrew Chase

unread,
Jan 23, 2002, 3:07:07 PM1/23/02
to php-g...@lists.php.net
> -----Original Message-----
> From: Joffrey van Wageningen [mailto:jof...@playcollective.com]
> Sent: Tuesday, January 22, 2002 7:35 AM
> To: php-g...@lists.php.net
> Subject: Re: [PHP] PHP Chat REALTIME
>
> the real problem is how to get the data to the client without
> use of a socket

I've been tinkering with PHP-GTK of late and just the other day it occurred
to me that some sort of messaging client would be a great way to get my feet
wet - by authoring in PHP on the client side (instead of trying to kluge
something together in a web browser), sockets would cease to be a problem.
:) I hadn't really considered the particulars of setting up a PHP script to
essentially act as a messaging "server", so your posts have been quite
instructive. Thanks!

-Andy

0 new messages