Archived

This topic is now archived and is closed to further replies.

porgramming a chat in php

This topic is 5011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, i want to make a simple chat in php. but i dont know were to store the list of active users. can i do this via sessions? or is it better to save them in a file or a mysql database on my server?

Share this post


Link to post
Share on other sites
Where do I start...?

PHP, as commonly implemented for use in web browsers, does not maintain connections between server and client. Consequently, every time one visitor posted to the chat, all the others would have no way of knowing unless they refreshed the page. You could overcome this by having the page refresh at set intervals, but then you run the risk of "refreshing away" a comment that is being typed.

In short, you''ve chosen the wrong technology. There''s a reason that web-based chat applets are written in Java. (Though you could use any language that runs on a client-side VM and maintains socket connections.)

Now if you''re talking about PHP outside the web, you have free rein.

Share this post


Link to post
Share on other sites
you want to do a chat with PHP.

For you don´t changing all program you can do somthing similar with this site when users want to post they insert the comment and the login and it''s easy to do.

Share this post


Link to post
Share on other sites