Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:comet:simple-php-chat-example [2017/05/18 04:27] levhav |
en:comet:simple-php-chat-example [2019/12/18 02:05] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <rst>EN::12-Examples::005-PHP chat example</rst> | ||
+ | <rst>Header: PHP chat example</rst> | ||
====== PHP chat example ====== | ====== PHP chat example ====== | ||
An example of using the [[https://github.com/CppComet/comet-server|CppComet]] server to create a chat. | An example of using the [[https://github.com/CppComet/comet-server|CppComet]] server to create a chat. | ||
- | [[https://jsfiddle.net/Levhav/o35kvmn2/17/|jsfiddle.net online demo]] | + | |
+ | * [[https://jsfiddle.net/Levhav/o35kvmn2/17/|jsfiddle.net online demo]] | ||
+ | * [[https://github.com/CppComet/php-chat-example|Github repo]] | ||
{{ :en:comet:chat.gif |chat demo}} | {{ :en:comet:chat.gif |chat demo}} | ||
Line 37: | Line 41: | ||
- | ====== Step 2. send message to server ====== | + | ====== Step 2. Send message to server ====== |
* Send ajax query to php back-end | * Send ajax query to php back-end | ||
Line 60: | Line 64: | ||
- | ====== Step 3. receive message from comet server ====== | + | ====== Step 3. Receive message from comet server ====== |
- | subscription Code to the pipe on comet server. This callback will be called when somebody send message into channel `simplechat` | + | Subscription code to the pipe on comet server. This callback will be called when somebody sends message into channel `simplechat` |
<code JavaScript> | <code JavaScript> |