Skip to content

xcombelle/minimicrochat.php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

minimicrochat.php

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

Installation Instructions

  1. Verify that your hosting environment has sqlite enabled for PHP. Most do.
  2. Upload index.php to a folder in the webroot. (ie. public_html/yo/)
  3. Verify that your script / apache will have access to write the sqlite file to the directory.
  4. Provide a link to the directory (http://yourdomain/yo/) to anyone you want to chat with and begin chatting.

Quirks

  • 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.

The story

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.

Note: Security Concerns

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.

About

the simplest chat server I could write in two hours

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%