minimicrochat.php is the smallest, most compact, chat client I could code and test in under two hours. It uses only vanilla PHP5 with embedded SQLite
- Verify that your hosting environment has sqlite enabled for PHP. Most do.
- Upload
index.php
to a folder in the webroot. (ie. public_html/yo/) - Verify that your script / apache will have access to write the sqlite file to the directory.
- Provide a link to the directory (http://yourdomain/yo/) to anyone you want to chat with and begin chatting.
- There is no automatic polling for messages, but since the program auto-focuses to the input field and ignores empty input, you can easily press enter to poll for new messages.
- By default the last 25 messages are shown.
- A new table to store messages is created every day, old messages stay in the database but you'd need another simple tool to access them. To delete the chat log and start anew, simply delete the
yo.sqlite3
file. - Users are distinguished by an RGB color generated from a hash of their IP address.
A friend of mine had all chat avenues blocked by his company. We really like chatting during the day, and so I took two hours and banged out the simplest possible php script that would make it so we could easily chat, and not be suspicious in any way to his IT department. My design goals were:
- No AJAX
- No database server
- Lightning fast performance
- As configuration free as possible
- As few moving pieces as possible
- Should work on almost any shared hosting (especially mine)
- Valid HTML5
- Should be able to distinguish users from each other.
This software is only for ad-hoc chatting when other avenues of chat are restricted. It should be free from SQL injection risks but if a spammer discovers it they could easily grow your SQLite file to huge proportions.