bobtutos Posted August 6, 2015 Share Posted August 6, 2015 Dear all, Detect whether user is online/offline or typing I am working with php/mysql,jquery and actual want to advance my php skill, Now I am interested in doing something similar with fb chat which tells you if the receiver seen your message and it notifies when somebody is typing to you back. Also I want to detect whether user is online/offline I know here is the right place to be helped, if anyone can give me the URL to where this kind of discussion had been made or provide me with tutorial or any hints that could help me to achieve this. Your helps are highly appreciated Thank you. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 6, 2015 Share Posted August 6, 2015 You can't really detect when someone is offline, there are only workarounds for it. For example, you can set up an ajax request that sends every 30 seconds, and once it stops sending you consider them offline. Those kinds of things mean you need to store the last activity time in your database and then you can check to find everyone who has activity within the past minute or so, and consider them online. You can use key events like keyup, keydown, and keypress to detect when someone is typing and use an ajax request to send that information to store in your database. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now