Nettus has published a tutorial of “How to Create A Simple Web-based Chat Application“. In the tutorial we will be creating a simple web-based chat application with PHP and jQuery. This sort of utility would be perfect for a live support system for your website.
The chat application includes a login and logout system, AJAX-style features, and will also offer support for multiple users. Also, you can work off this and build a multiple chat rooms, add an administrative backend, add emoticons, etc…
Requirements: jQuery Framework
Demo: http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-simple…
License: License Free





Well done! I like this very much! I wouldn’t be using it any time soon, but it is great to know where an easy to use one is
THUMBSUP!
glad that its built using jQuery.
good using of j-query
thanks for this info
thanks
Hi!
You don’t check the length of $_POST['name'].
An attacker can inject into the session any type of large content. (the size depends on post_max_size constant in php.ini)
So the attacker can take down your site with a nice dos:
while (true) {
start_a_new_session (eg. delete cookies)
post_a_large_content
}
Behalf the line
$_SESSION['name'] = stripslashes(htmlspecialchars($_POST['name']));
write eg.
if (strlen($_POST['name']) < 100) {
$_SESSION['name'] = stripslashes( htmlspecialchars( $_POST['name']));
}else{
die(’bad luck’);
}
or something similar.
Szeim,
Agreed, but instead of…
if (strlen($_POST[’name’]) < 100) {
It should be…
if($_POST['name'] != “” && strlen($_POST['name']) < 100){
This way we can at least make sure that some sort of name is applied. If $_POST['name'] != “” isn’t included, anyone can login to the chat without a name.
RSS feed for comments on this post · TrackBack URI