plzz help me some one to solve this problem as early as possible...

Recommended Answers

All 9 Replies

What kind of information are you looking for ?

i need the php code to do that function .i have a list of registered members in my database out of them how to know which uer is currently in my site.session_start() of php do this ?or not.if we set $_SESSION then is there any possibility to know which users are currently online?

If they have to login, then you can store that user in a session. If you want an overview of all the people online, you may want to store that in the database.

how to store all those session variables.i don't understand u clearly when person is logged in in my code i store his userid in session variable but i dn't know exactly where this details about sessio variable will be stored i think they will be stored in users hard disk and how to store this session variables in my database?

If they have to login, then you can store that user in a session. If you want an overview of all the people online, you may want to store that in the database.

What pritaeas means is when you user logs in, then there would be an extra column in your table for your users called for example active. When the user logs in then your log in script will update this field to 1, then when the user logs out it could change it to a 0.

Even better would to be to have another column as well as the above which has an expire time, so when the user logs in it is set to active, and the expire time is set to the same as the death of the cookie. This means that you can have another script that checks this table updating all the statuses of the users who are marked as active however the expire time has passed.

Well that is a bit more detail, but all credit goes to @pritaeas for solution.

commented: Thanks for explaining ;) +14

my doubt is all about how to activate the active variable in database means i could we know user is accessing my site.sorry if i am disgusting you plzz dn't mind and help me.

sorry if i am disgusting you plzz dn't mind and help me.

Don't worry we can't all know everything, although it would be nice :)

Here is it briefly:

Well if the user has logged in then they are active? At the time of activating the member login, update the table in the database. Then when they log out they are not active so update the database table to reflect this.

What is it you do not specifically understand? And we can do each step at a time.

well now i got clear picture thaq.

Ok that is great to hear, could you please mark the thread as solved, and give rep to the people whom helped. Glad we could help :)

Thanks

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.