Welcome to Dream.In.Code
Become a PHP Expert!

Join 149,489 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,292 people online right now. Registration is fast and FREE... Join Now!




live chat using php

 
Reply to this topicStart new topic

live chat using php

devangnegandhi
23 Feb, 2007 - 07:05 PM
Post #1

New D.I.C Head
Group Icon

Joined: 23 Jan, 2006
Posts: 39


Dream Kudos: 100
My Contributions
i wanted to find out how can i make a webpage which performs live chat...... i am looking for a technique which will not use the traditional technique of browser refresh to show new messages but instead a server push which will immediately push any new messages on to the clients browser...... i know there is a technique as sites like meebo.com and others use it....... its called long-polling or comet i think.......not sure though........ i wanted to find out more on it??? anyone pls!!!!
User is offlineProfile CardPM
+Quote Post

Craige
RE: Live Chat Using Php
24 Feb, 2007 - 10:13 AM
Post #2

D.I.C Head
**

Joined: 2 Nov, 2006
Posts: 63


My Contributions
Zend Tutorials

Go through the results labled "AJAX Chat Tutorial Part..." in the proper order.

Also, note: it involves the browser sending requests to the server, not the other way around. The other way around, as you described, is impossible.
User is offlineProfile CardPM
+Quote Post

alpha02
RE: Live Chat Using Php
27 Feb, 2007 - 10:44 AM
Post #3

D.I.C Addict
Group Icon

Joined: 20 May, 2006
Posts: 687


Dream Kudos: 850
My Contributions
I made this using AJAX earlier. I will be happy to send this to you so yo can use it. Overall here is how it works:
-The browser sends an AJAX request to the MySQL database in the MESSAGES table to fetch messages.
-The broswer formats this text to show in the chat window.
-The browser send an AJAX request to the USERS table to get online users (in the chat) and deleted timed-out users (with a timestamp).
-The browser formats and shows this information.

When you send a message, it is simple: an AJAX script writes the message in the MESSAGES table. The other users' AJAX requests will fetch this one.

Smileys are enabled. The window itself has a dark green skin. I will send it to you in a few hours, because I am not at home.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 05:14PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month