PDA

View Full Version : help:flash-php chat


iota
11-13-2006, 05:45 PM
Hi

I'd like to create flash-php chat.
I have no clear idea on how chat system is.
I don't wanna rely on those freely downloadable stuffs which make us totally lazy men.

I invoke flash to loadvars from chatlog.txt under 5 seconds.

I simply create 2 php files : one that read chat log texts and the other that writes messages from users.

The problem is that IE browsers or maybe my ISP cache that chat log text file and can't display the lastest writes to chatlog.txt.

I prevent it with no cache php header, but it's in vain.

Any idea? Please see the attachment.

Thank you so much.

PS. the demo url is
http://www.ak.flashmo.com/webdev/tmp/chat/chat.html

Spudhead
11-14-2006, 05:15 PM
Well... IMO you could use AJAX to update the textbox and that'd sort your caching issue (bless you! :D) But you're running this directly off text files? What sort of scalability are you aiming for? One user? More than one user? As many as three concurrent users? That chat log file is going to get fairly big very quickly and it's going to get hit (presumably for its entire contents at the moment?) every time a user posts a comment. At the very least, stick this into a database where you can manage data access a bit easier and probably speed up your access time. But... well, I dunno much about chat apps but I'd imagine that most of them seem to take the form of a Java applet for a good reason - you can't effectively manage that sort of realtime state management via HTTP GET and POST. "Lazy men" we may well be, but if someone's already done what I'm trying to do I'll at least wonder why they didn't do it the way I'm trying to.