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
live chat like face book
Moderator: General Moderators
-
shafiq2626
- Forum Commoner
- Posts: 88
- Joined: Wed Mar 04, 2009 1:54 am
- Location: Lahore
- Contact:
Re: live chat like face book
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.
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.