live chat like face book

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shafiq2626
Forum Commoner
Posts: 88
Joined: Wed Mar 04, 2009 1:54 am
Location: Lahore
Contact:

live chat like face book

Post 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
Sinkrad
Forum Newbie
Posts: 5
Joined: Wed Sep 09, 2009 6:27 am

Re: live chat like face book

Post 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.
Post Reply