Jump to content
xisto Community
Sign in to follow this  
Dawiss

Show Users Logged In Some help needed..

Recommended Posts

I need some help if somebody can help me out please doit :lol:..Ok here is the thing - I have an login box (works perfect) and I have MySQL database (works perfect).. Now I need to make thing like a list where shows everyone who is logged on.. But making it I need to use the same MySQl database and the same login box.. Example: when your write tour Login and password and press "Log-in!" opens page where is list of all logged in member..If there is ant tutorial aor scripts/codes please help me becaus eit's very important..Big Thanks alredy :P

Share this post


Link to post
Share on other sites

you need to write a query to pull the information from the database.

something along the lines of

SELECT * FROM "db table" WHERE "column" = 1

Table is the table that has the column which sets the user to Logged in
Column is the part that is 1 or 0.
Edited by Klass (see edit history)

Share this post


Link to post
Share on other sites

emm.. I found a tutorial where from database they take user IP adresses and lists them.. Maybe if I change the IP adresses to the Logins then they will show logged in member names not IP.. will it work?Thanks Klass for the idea and help :lol:..

Share this post


Link to post
Share on other sites

You need 'something' to track those who are logged in. When they log-out, reset the field accordingly.Since we can't see your database fields, it is hard to determine whether the database already has something to use for this function. Or whether you would have to add something. Also, what if a User doesn't 'log-out" but simply closes their browser? How would you know if they are still logged in? Some things to consider.

Share this post


Link to post
Share on other sites

I would suggest storing a timestamp of when the user logs in, updating it every time that user visits a page within your site. Then once they haven't been active for, say, 20 minutes, you mark the session as logged out. IPB uses something along these lines to determine how many users are currently active.

Share this post


Link to post
Share on other sites

Nice idea but where to get script like that Spectre.. because thats what would be perfect for my website :lol:..

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.