I have a website where users can add their friends. What I am trying to achieve is to show every user that who are their friends that are currently online. If any one knows a link to any script or tutorial that explains this, Please help.

Recommended Answers

All 3 Replies

Hi

you have to create a table in sql friends for every user. in this table store detail of their Friends. And when user login to website check his id or username in these friends table if data found display the name to users

code to set a user online
what you could do which im am gonna do is check the users are friends then on every link that user clicks it update's the (lets say) Time table with there id and the time + X mins.

now with the other friend looking to see who is online
check the time table for friends and check the friends to see if the current time is less then time + X mins if so we know that friend is online

code to set a user online
what you could do which im am gonna do is check the users are friends then on every link that user clicks it update's the (lets say) Time table with there id and the time + X mins.

now with the other friend looking to see who is online
check the time table for friends and check the friends to see if the current time is less then time + X mins if so we know that friend is online

you could also try creating a php/mysql chat with this i have done it once and it worked fair well

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.