PHP Classes

AJAX driven simple chat: Web based chat using AJAX to update the dialog

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 52%Total: 19,564 All time: 36 This week: 41Down
Version License PHP version Categories
ajax-chat 2.13Freely Distributable5.0Chat, AJAX
Description 

Author

This class can be used to implement a simple Web based chat system that uses AJAX to update the chat dialog display area without reloading the whole page.

The class generates a page with a Web form to submit what each chat line that the users type.

The chat lines are sent to the server using a jQuery AJAX API.

The chat lines are received by a server side script that uses the class to store what each user entered in a MySQL database table.

In response, the class outputs the chat list already formatted to by displayed in the user browser pages.

Innovation Award
PHP Programming Innovation award nominee
July 2006
Number 3


Prize: One subscription to the PDF edition of the magazine by PHP Architect
Chat applications are usually very interactive. Users exchange many messages, often very frequently.

Some Web based chat applications are a bit annoying, as they require frequent page reloading to update and display the messages that the users exchange.

Nowadays, using AJAX is an obvious approach to avoid unwanted page reloads. This class implements a AJAX based chat system precisely to take advantage of that possibility.

Manuel Lemos
Picture of Ashraf Gheith
  Performance   Level  
Name: Ashraf Gheith <contact>
Classes: 9 packages by
Country: Bosnia and Herzegovina Bosnia and Herzegovina
Age: 41
All time rank: 131 in Bosnia and Herzegovina Bosnia and Herzegovina
Week rank: 240 Down1 in Bosnia and Herzegovina Bosnia and Herzegovina Equal
Innovation award
Innovation award
Nominee: 1x

Recommendations

Live Chat Using Ajax,PHP and Mysql
i need source code to an Ajax, Php and MYsql live chat.

Example

<?php
    session_start
();
        require_once(
"config.php");
    require_once(
"inc/chatClass.php");
   
$chattext = strip_tags( $_GET['chattext'] );
   
chatClass::setChatLines($chattext,$_SESSION['usrname'],$_SESSION['color']);
?>


Screenshots (2)  
  • chat.jpg
  • index.jpg
  Files folder image Files (12)  
File Role Description
Files folder imageinc (1 file)
Files folder imagecss (1 file)
Files folder imagejs (2 files)
Plain text file config.php Conf. config file
Plain text file chat.sql Data The SQL code
Plain text file refresh.php Example Retrieve data from class
Plain text file submit.php Example Submits data to the class
Plain text file login.php Aux. Example file
Plain text file index.php Aux. Example file

  Files folder image Files (12)  /  inc  
File Role Description
  Plain text file chatClass.php Class The Main Class

  Files folder image Files (12)  /  css  
File Role Description
  Plain text file main.css Data Style sheet file for the example

  Files folder image Files (12)  /  js  
File Role Description
  Plain text file jquery.min.js Data Jquery library for the example
  Plain text file main.js Data Javascript file for the example

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:19,564
This week:0
All time:36
This week:41Down
User Ratings User Comments (11)
 All time
Utility:75%StarStarStarStar
Consistency:73%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:52%StarStarStar
Rank:2442
 
very poor this plugin
6 years ago (vito)
0%Star
very poor this plugin
6 years ago (vito)
0%Star
Nice work.
6 years ago (Zhomas)
70%StarStarStarStar
thanks
8 years ago (DrShyam Babu Gupta)
70%StarStarStarStar
Hi , Thanks for your tutorials .
9 years ago (Naveen)
70%StarStarStarStar
Very good just what i was looking for, i can expand on this, ...
9 years ago (Terry DeSimone)
70%StarStarStarStar
Quite brilliant!
9 years ago (richard marcus)
65%StarStarStarStar
Not work
9 years ago (Anant kumar singh)
0%Star
Simple and efficient
10 years ago (Eudemar Tonatto)
70%StarStarStarStar
some code that doesnt do anything, waste of time
13 years ago (Benni)
0%Star
Excellent
15 years ago (kishore kumar)
70%StarStarStarStar