This topic is locked

Logon and Logoff Times

7/28/2008 4:06:14 AM
PHPRunner General questions
S
swanside author

Hello.
I have these fields in my Login table
Engineer_Name

Password

Group_ID

Login_ID

email

active
And these fields in my Login Events table
log_id

Name

login_time

logout_time
What I want to do, When an Engineer logs on or Logs Off using the information from the Login table, I want it to log this in the Login_Events table
ANy help please?

Thanks

Paul.

J
Jane 7/28/2008

Paul,
to add new record to the Login Events table use AfterSuccessfulLogin event:

globla $conn;

$strInsert = "insert into Tablename (Name,login_time) values ('".$_SESSION["UserID"]."',now())";

db_exec($strInsert,$conn);


There is no easy way to save logout time stamp because user can close browser or go to another page and you can't capture correct date and time.

S
swanside author 7/28/2008

Paul,

to add new record to the Login Events table use AfterSuccessfulLogin event:
There is no easy way to save logout time stamp because user can close browser or go to another page and you can't capture correct date and time.


Thanks

Jane