Hi i am making my own game and wanted to add a part to my site with the online status of my game, being online or offline and users online how do i do that? im a basic learner with html and php
Printable View
Hi i am making my own game and wanted to add a part to my site with the online status of my game, being online or offline and users online how do i do that? im a basic learner with html and php
@scottish;
Sent from my iPhone using Tapatalk
Without a lot more information to base your request off of, it can be very easy to do, or slightly more involved.
A few questions would be:
1. How do you want to determine someone's online/offline status? Are you basing it on amount of time "idle" or just based on clicking a logout/login button?
2. Based on the above, if amount of time is your determination, how long is your "idle" requirement before you want them logged out?
3. Do you already have a database of users?
Without much information, your basic setup will be as follows:
Using appropriate queries, you can then show users based on their "online" or "time stamp" status.
- Database is created to store users with certain criteria columns you need, I.E online/offline, time stamp (if you're basing it on "idle" time) and so on.
- User logs in > session for that user is created and "online" or "time stamp" is set.
- User logs out > session for that user is destroyed and "offline" is set or "time stamp" is updated.
- User does some sort of activity (based on "idle" time) > check "time stamp" to see if it's over the amount of your "idle" setting, and if so, destroy the session and "time stamp" is updated.
Anyoneee