How to Easily Make “Ajaxy” Chat application with PHP + SQL + jQuery
Today I will tell you about another chat system. After making old-style chat described in previous post I decided to make modern, pretty version. I made several enhancements:
- a) Login system. Now it using database to keep members. Also it have easy methods to take some necessary info about logged member.
- b) Chat interface. Now it much more user friendly. And show last added messages via toggling (based on jQuery). Looks fine.
- c) Inner code structure. Now here are good order. All libraries in ‘inc’ folder, all javascripts in ‘js’ folder, all template-related files in folder ‘templates’. More, class organization: now we have useful DB class, class of login system, chat class too.
- d) of code safety. Added necessary methods to protect from hack attacks. As example function process_db_input in our DB class.
So, as result – we will able to chat with our logged members. We will use database to store messages as usual.
(more…)