Jump to content

Need Guidance For Live Chatting Code In Php


kunal_kagalkar
 Share

Recommended Posts

I'm not sure if PHP is the most indicated language for that. For a chat application you need a listener on the server, and another one on each client. The server is constantly listening for signals from the clients, and then sending data back to the clients. This is done with Sockets.PHP has the fsockopen() function, but you couldn't just do that from a PHP page, you'd need to run a PHP application from a command prompt. Most hosting services won't allow you to have a listener on the server-side, or they'll charge you a whole lot for the bandwidth.It's better to have a Java or C++ application listening on the server-side and Flash or a Java applet on the client.

Link to comment
Share on other sites

I'm not sure if PHP is the most indicated language for that. For a chat application you need a listener on the server, and another one on each client. The server is constantly listening for signals from the clients, and then sending data back to the clients. This is done with Sockets.PHP has the fsockopen() function, but you couldn't just do that from a PHP page, you'd need to run a PHP application from a command prompt. Most hosting services won't allow you to have a listener on the server-side, or they'll charge you a whole lot for the bandwidth.It's better to have a Java or C++ application listening on the server-side and Flash or a Java applet on the client.
Thanx for replyThen how can other languages are done live chat in pages?
Link to comment
Share on other sites

There is always an option of chatting where one page is split into two frames, one frame for posting the message, then the other frame (often top frame) for the receiving of message (which refreshes every minute or so) and retrieves the last 5 messages or so from a database?(obviously when posting a new message it will have to be sent to a database)Although I'm not sure if this is any use it was just an idea for you to possibly consider?If you want more information i'd be happy to help?

Edited by morrisjohnny
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...