Page 1 of 1

live chat like face book

Posted: Mon Jan 03, 2011 1:43 am
by shafiq2626
Hi to all
I am creating an application like face book.
I have a user table and user's partner table.

attribute of tbl_user
user_id ,name,userid,password,date,status

attribute of tbl_partner

p_id,user_id,partner_id,date

How I can found that which is my partner online now and how i can chat with him.

Please help with thanks

Re: live chat like face book

Posted: Mon Jan 03, 2011 2:06 am
by Sinkrad
You can use ajax to send a message to the server every 3 seconds with the username.
If the server gets this message he updates the onlinetime to the current time.
to find who is online you just seek for persons with: current time - 7000 (7 sec) < onlinetime.

I hope this answers your question, you will have to use ajaxif you don't want to refresh the page every 3 secs.