AndyPSV
asked on
How to write a php chat?
I'm mainly considered about the reload page issue.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The other guys seem to have a handle on this topic, but here's my two cents.
Normally, I don't suggest commercial software, but I've used PHP Live! (version 2.3 - they're up to 3.3 now) in two different projects and it's worked pretty well. It's a good deal for the price - $50 one-time cost for the full source code, so it's potentially cheap enough to save more money in terms of coding time/cost (unless you need to program it from scratch). I wouldn't bother with the add-ons, though. And I promise I don't work for the company or have any ties to them beyond just using their product. :)
Normally, I don't suggest commercial software, but I've used PHP Live! (version 2.3 - they're up to 3.3 now) in two different projects and it's worked pretty well. It's a good deal for the price - $50 one-time cost for the full source code, so it's potentially cheap enough to save more money in terms of coding time/cost (unless you need to program it from scratch). I wouldn't bother with the add-ons, though. And I promise I don't work for the company or have any ties to them beyond just using their product. :)
Oops. Forgot the URL:
http://www.phplivesupport.com
http://www.phplivesupport.com
ASKER
I've bought already this: http://yurivish.com/yshout/
Could anybody paste here the code for jquery which would allow to refresh window?
Could anybody paste here the code for jquery which would allow to refresh window?
In general I would however suggest a solution that fits with your requirements, and those can be very different.
If you need to host a chat for many people, with rooms etc and want to have a professional setup, the best is an IRC server. You can then have different programms access this server, Windows, Linux IRC clients and PHP/PERL/JAVA frontends for web users.
On the other hand, if you want to offer chat on your website only for a couple of users, you will always find a huge number of plugins for different CMS packages, standalone solutions to integrate into your website.
I can only support what grvulture said. It is not easy to write that yourself. It's a huge project. If you do not know how to do it and go for it, you should consider it as a learning exercise rather than having the goal to complete it soon. If you want to have a solution in a reasonable time, install something pre-made. There is a lot of it out there for free.
If you need to host a chat for many people, with rooms etc and want to have a professional setup, the best is an IRC server. You can then have different programms access this server, Windows, Linux IRC clients and PHP/PERL/JAVA frontends for web users.
On the other hand, if you want to offer chat on your website only for a couple of users, you will always find a huge number of plugins for different CMS packages, standalone solutions to integrate into your website.
I can only support what grvulture said. It is not easy to write that yourself. It's a huge project. If you do not know how to do it and go for it, you should consider it as a learning exercise rather than having the goal to complete it soon. If you want to have a solution in a reasonable time, install something pre-made. There is a lot of it out there for free.
The software you bought is already a complete "chat" solution! What do you mean "paste here the code"? The "YShout" application has this already!
I think you are at the beginner level on this, you should really re-consider, and learn how things work first. No offense, friendly advice...
I think you are at the beginner level on this, you should really re-consider, and learn how things work first. No offense, friendly advice...
You could have all process being made on a hidden iframe, and from there Javascript can update your elements on the parent document.
This method is not very stable however, and I would strongly suggest that you use AJAX to send your data to php files where you will process all input and output. Once processed, use simple Javascript to update your elements on the page.
A chat application is not a simple script! I've developed a kind of chat commenting system where comments on user activities update live through the internet, so it can be used as a chat application also, since you can chat with other users on the comments section.
You can check it out here http://partypeople.gr (login: usr=user pwd=activity)
I've attached a Code Snippet from the native Javascript (no libraries loaded) AJAX file here, so you can have a taste of what you need...
The script on http://partypeople.gr uses the jQuery library for the convenience of the display effects and the ease of AJAX calls handling
Open in new window