Live Help / Live Chat service in PHP

21:52.50 - Thursday 7th September 2006   (Link to This Entry)


I'm celebrating the return to something approaching normality by hitting the PHP again and delving into the murky world of LiveHelp applications. You may have seen 'em before - a buton on a website that says 'Live Help is Available' or similar. I used one just the other day and decided to write one myself using PHP.

The client side is done, and it's basically an input box and an IFRAME for displaying contents. The INPUT submits to a hidden IFRAME which updates the database (all chatlogs can be reviewed by the admin later) and clears the box.

Another hidden IFRAME refreshes every X seconds (it'll be configurable but it's currently 3) and checks the last post recorded in the chat table with the last post recorded in the chatlog table. If they're different, it tells the display frame to refresh.

So far I can also boot the people I'm chatting with in one of two ways: I can either set the chat status of that person to '0' or I can bump absolutely everyone off at the same time by setting the service as unavailable - all handled via the database.

Tomorrow's task (I hope) will be to write a server bit which monitors the database for open chats and creates a kind of control panel. This will let me have several chat windows open at once and I can talk to different people about whatever. I'll have to give it a try on this site once it's ready, so if you see some kind of 'LiveDude is Available!' link, feel free to click it and have a gossip.


[ 3 comments pending ]