使用 php 和 mysql 可以做的最好的事情就是创建一个公告板类型的系统,人们可以在其中向“频道”添加评论,然后重新加载页面进行更新。
The best you can do with php and mysql is create a bulletin board kind of system where people add comments to a "channel", then reload the page to update.
In general, I think, it is a bad idea to use PHP for this kind of project. Every client hast to reload the page (mentioned bulletin board e. g.) every few seconds to get informed about updates.
If you want to code in PHP and a little javascript, try Jaxl library Web Chat sample application. Can be worked upon to build a full fledged chat systems. http://github.com/abhinavsingh/JAXL. XMPP protocol is the way today, when it comes to chat client :D
发布评论
评论(4)
您可能会想要使用 AJAX,或者如果不是的话,也可以使用带有计时器的 Javascript 来使聊天显得即时或进行轮询更新。
有很多关于创建类似内容的教程 - 包括使用 AJAX i/o 的数字 - http://css-tricks.com/chat2/
You will probably want to use AJAX or if not that, Javascript with timer to make chat appear instant or with polled updates.
There are lots of tutorials on creating something like this - including a number with AJAX i/o - http://css-tricks.com/chat2/
使用 php 和 mysql 可以做的最好的事情就是创建一个公告板类型的系统,人们可以在其中向“频道”添加评论,然后重新加载页面进行更新。
The best you can do with php and mysql is create a bulletin board kind of system where people add comments to a "channel", then reload the page to update.
总的来说,我认为,在此类项目中使用 PHP 是一个坏主意。每个客户都必须每隔几秒钟重新加载页面(例如提到的公告板)以获取更新信息。
In general, I think, it is a bad idea to use PHP for this kind of project. Every client hast to reload the page (mentioned bulletin board e. g.) every few seconds to get informed about updates.
如果您想使用 PHP 和一点 JavaScript 进行编码,请尝试 Jaxl 库 Web 聊天示例应用程序。可以致力于构建一个成熟的聊天系统。 http://github.com/abhinavsingh/JAXL。当谈到聊天客户端时,XMPP 协议就是当今的方式:D
If you want to code in PHP and a little javascript, try Jaxl library Web Chat sample application. Can be worked upon to build a full fledged chat systems. http://github.com/abhinavsingh/JAXL. XMPP protocol is the way today, when it comes to chat client :D