I'm writing a web chat for a company's customer attention. The idea is that the company has an operator who uses always the same registered nick and connects to irc with mIRC or whatever. The customers connect to irc throw this web chat I'm trying to make.
When the customer is logged in, a msg is automatically send to the operator telling him you have just connected.Now they can chat p2p.
The problem is that the script is in its listen() loop and i cant output the message when it arrives, i have tried using frames (and iframes) and making the script write the input in $_SESSION and in another other frame read $_SESSION every x seconds. But it doesn't works, nothing is shown until call disconnect() (when the page finish loading)
What am i missing? Any ideas?Excuse my poor english, hope you got the idea and give me a hand!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm writing a web chat for a company's customer attention. The idea is that the company has an operator who uses always the same registered nick and connects to irc with mIRC or whatever. The customers connect to irc throw this web chat I'm trying to make.
When the customer is logged in, a msg is automatically send to the operator telling him you have just connected.Now they can chat p2p.
The problem is that the script is in its listen() loop and i cant output the message when it arrives, i have tried using frames (and iframes) and making the script write the input in $_SESSION and in another other frame read $_SESSION every x seconds. But it doesn't works, nothing is shown until call disconnect() (when the page finish loading)
What am i missing? Any ideas?Excuse my poor english, hope you got the idea and give me a hand!
sounds like you have a PHP output buffer, flush the output on each echo() and it should fine, see:
http://www.php.net/flush
Thanks meebey it worked!