Jump to content

Can someone help new to php and mysql


artweb

Recommended Posts

I have a php login page that checks against a mysql database, to find if user have a password and username stored in the database. If they do they are allowed into the members only part of my website.

 

But what I need is once a user is successfully login, is to be able to know the time they login and the date and how long they spent login. I don't want the user to have to logout, I want that to be automatic, after a certain period of time. ???

 

I have no cue of how to do this. Do I need another table in my database to store the users info? or do I need to use sessions and cookies somehow?

Any help would be greatly appreciated. ;D

Link to comment
Share on other sites

But what I need is once a user is successfully login, is to be able to know the time they login and the date and how long they spent login.

 

if I will be the one to code that i will do it this way..

create a table that has this fields( if you want to track all the user log every session they made in the site)

*once the user log store the id of the user on your db  together with the time the user logs

*everytime the user refresh the page update your field with the current time.

in this case even if he turn the PC off everything is recorded you dont also have to worry about closing the browser

 

maybe this isn't that good, any one has better idea?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

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.