Hi there,
Understood the requirements. I can code this for you in JavaScript/PHP, AJAX - so it will be a good solution if you don't need it to be real time - ie. about 5 second delay is fine with you. I wouldn't suggest that if you're looking for instant chat. For instant chat you'd need node.js, I have less experience with it. let me know if you need it real time or just a messaging system with a few seconds delay?
Regards,
Julijan