Ajax Chat

Php based Ajax Chat. It's an easy to use ajax chat script, it has spam filter capability and it only needs 3 files (index.html, w.php and chat.txt) Index.html reads the content & sends your message to w.php. w.php writes the content and prunes it to $maxlines lines

Ajax Chat demo

Changes to the code below will update the demo above in real time.



June 16, 2007, 12:40 a.m. - Pepito

esto es un comentario

July 17, 2007, 4:14 p.m. - d

Its to slow for chat!

July 17, 2007, 8:14 p.m. - it2051229

aaawwwweeeeesssssssooooooooommmmmmeeeeeee.. let me steal it.. heeheheh

Aug. 3, 2007, 3:50 a.m. - FlashStr

Its not too slow, its quite nice. Good job.

Aug. 14, 2007, 9:58 a.m. - Stan

nice but too slow refreshing

Aug. 23, 2007, 10:35 p.m. - Mark

Sorry but I don't like the design =(

Sept. 8, 2007, 8:10 a.m. - roturkiye

not slow for chat, maybe you can change this variable for better performance var waittime=800

Sept. 14, 2007, 2:27 a.m. - Jacques de Molay

Is it available for Windows xp?

Oct. 5, 2007, 5:09 a.m. - srilekha

itz very nice

Nov. 22, 2007, 3:29 a.m. - Jennifer

Gear up for grub with a tripleheader of pigskin, including a meeting of brothers in Dallas. Everybody knows it's been a rough year for her, but find out who else had issues

Dec. 2, 2007, 5:11 p.m. - ben

i wonder if this would be easily intergratable with mysql or if a xml has to be used as an intermediate between the two.

May 5, 2008, 7:36 p.m. - Dubai

at least better then my chat lol

May 6, 2008, 2:07 a.m. - Ikea

Nice script..but slow for a chat..

June 3, 2008, 12:41 a.m. - WineX

Why this script doesn't support Russian language? How can i use it with Russian?

June 4, 2008, 4:39 a.m. - thiru

its very good

June 20, 2008, 3:50 a.m. - Rajith

seems to be very better and simple

June 25, 2008, 1:57 p.m. - Datacide

time(/date) integration would be great. Would be easy to do too

July 2, 2008, 2:41 p.m. - mahdi

can i use this in the blog?

Sept. 12, 2008, 9:41 a.m. - What

Doesn't this just hit the server repeatedly, polling for info? If so, what are the performance implications with say, 200 ish users (with wait at 800ms that means you are getting more than 200 requests every second).

Sept. 26, 2008, 4:23 a.m. - Swati

Wow ....Its Great!!!!

Nov. 16, 2008, 12:53 p.m. - majid

hi! i am majid my id is abdulmajid11@hotmail.com please guide me if i can get a asp.net virsion for this chat script.... i would be waiting for your response

Nov. 23, 2008, 1:39 a.m. - chris

as an answer to the speed question: the chat script got dugg and mentioned on wired last year and stayed up even on a medium-quality hoster without any problems... since the requests are small in size, it was able to handle a few hundret (or even more) users at once. and yes, you can use it in your blog, your homepage or whereever you want. just need to include the html tag and the javascript, and on the backend side the w.php and a writeable chat.txt.

Nov. 25, 2008, 12:48 a.m. - vimal

good thinking

Jan. 8, 2009, 2:51 a.m. - toino

I have a problem... the chat is ok, but when i want to validate for xhtml 1.1 it has this error: ajax_write("w.php?m=" + msg + "&n=" + nick); I have used: "&" but i don't see the nickname... how can i resolve it?

Jan. 8, 2009, 2:53 a.m. - tonino

sorry... i have used &

Jan. 8, 2009, 2:54 a.m. - tonino

sorry... i have used & amp ;

Jan. 8, 2009, 11:40 a.m. - Tonino

I have tried with opera and with explorer and it is ok, instead with firefox it isn't goes

Jan. 8, 2009, 12:32 p.m. - Tonino

i see the "chatwindow" without messages if i use firefox

March 5, 2009, 9:55 a.m. - honar

Cool! but it don't support utf-8 characters like: سلام

March 9, 2009, 11:36 p.m. - Ravikumar V.

hi, can we see the old msgs... ?

May 6, 2009, 8:59 a.m. - khaloody202

how are u guys

May 13, 2009, 11:41 a.m. - Renzo

esto es una prueba

June 9, 2009, 6:12 a.m. - ram

how can i get this to work using visual studio? The text file is not being updated when the add button is being pressed.....thanks

June 15, 2009, 10:28 a.m. - Stéphane

Nice script but there is a bug with IE and I can't found where it is, surely in javascript somewhere : You can't type twice same thing. Ex: you send just the mord 'yes' then some others line and want to say 'yes' again, nothing happen... :(

June 16, 2009, 4:33 a.m. - Ameen Islahi

How can I use this?

July 5, 2009, 4:55 p.m. - david

No acepta acentos ni ñ. Imposible type in spanish. No ñ, No á é í ó ú.

July 20, 2009, 9:36 p.m. - Djack

How to protect this script, so nobody can submiting a chat message using that url into browser.. Thanks

Aug. 5, 2009, 12:08 a.m. - din

cool,,, very interested, permission copying for study, thank's bro,,,

Aug. 27, 2009, 5:31 p.m. - luke

hows it goin

Aug. 28, 2009, 1:28 a.m. - jason

thank you for code

Oct. 2, 2009, 10:54 p.m. - Angus

Whan I save the file.html in file.php, the chat does not work. Why and how can I solve it ?

Oct. 22, 2009, 3:39 a.m. - burak

latin charachters arent support

Oct. 22, 2009, 11:48 p.m. - SEO Karachi

it's great , i liked it.it works like shout box.

Oct. 28, 2009, 11:21 a.m. - Teja

best script on earth...i really like this script

Nov. 10, 2009, 3:24 a.m. - dzindzer

thnx great script

Nov. 28, 2009, 1:50 a.m. - Revathi

Nice concepts and code.....

Dec. 20, 2009, 10:31 p.m. - xXx

i have the same problem with Ram. I use visual Studio, when I pressed the button Add Nothing happen.

Jan. 26, 2010, 4:12 p.m. - Unicode

Not UTF-8???

Feb. 28, 2010, 11:05 a.m. - Eugene

Russians here??

Feb. 28, 2010, 2:07 p.m. - Eugene

I solved it for the Russian language. Should use the JS encodeURIComponent method - like this ajax_write("w.php?m=" + encodeURIComponent(msg) + "&n=" + encodeURIComponent(nick)); And you may write whatever necessary, charsets to hell... Are Americans going to win, you think???

April 22, 2010, 11:56 a.m. - peter

How i can write in Arabic in this chat?

June 4, 2010, 1:43 a.m. - CATS

all your base are balong to us

July 27, 2010, 2:16 a.m. - google

google chrome won't work for this?

Sept. 23, 2010, 2:32 p.m. - namy

it doesn'tworks at all with firefox

April 1, 2012, 12:43 a.m. - Brandon

This ajax chat is very noob-like, but a good start for beginners. First off, why would you ever even consider returning the entire message log on every response???? Yeah, I'm using firebug :D Suggestion 1, load it and only return new content since load. Suggestion 2, If no message has been received in longer than 5mins then delay the checking a bit. Suggestion 3, with about 15 lines of code you could include HTML5 sounds (all major browsers) for user online, user offline, message send and message receive. TLDR; Do not use this chat in any kind of production. Only use it to learn how to make a proper chat.

June 17, 2012, 8:38 p.m. - SHAWON

sorry admin..this script dosent work.... dhaka,bangladesh

Aug. 23, 2012, 9:39 p.m. - Kris

How to apply this ?

Oct. 8, 2012, 8:38 p.m. - yati

Doesn't work anymore. Can you fix it?

Nov. 29, 2012, 2:07 a.m. - Anon

Doesn't work in FireFox anymore. It used to work for me like a year ago. Is there a fix or reason why this script stopped working?