PHP Chat server in 2.5Kb

I got fed up with not having a decent place to chat with random colleagues and such, who don’t always have access to the same servers and accounts as I do.

A quick search on the web revealed no sensible service well suited to copy and pasting code, which is the number one reason I need to chat. For some reason, most people don’t seem to consider whitespace an important point in chatting…

So, as a solution, I rolled my own like a good code monkey. A total 2.5Kb of PHP + JS + HTML + CSS. Plus the data file for the chat log. And an optional htaccess file to keep people from directly accessing the data file. Don’t know why, I guess my tin foil hat was feeling a bit tight again.

The script: chat.tar.gz

EDIT 2012-06-24: A new version of the script, see comments: chat2.tar.gz

Test drive: chat.xird.fi

Published
Categorized as IT

1 comment

  1. A visitor called “Bernd” left a comment in the chat test drive saying how annoying it is to have to press enter to send the message. Normally, when chatting, that would be true. However, if you’re copy and pasting code back and forth, having enter send would be equally annoying.

    I’ve added an option in the script called “sendOnEnter”, which can be set to true or false.

    Still barely made it in 2,5kB, but had to shorten some variable names.

Leave a comment

Your email address will not be published. Required fields are marked *