matthewchristianson Posted July 6, 2007 Share Posted July 6, 2007 Is it possible in PHP, or in any other language to tell when a user logs into your system for the first time, as they are given a default password and username which must be changed. any help would be welcome Thanks Quote Link to comment Share on other sites More sharing options...
NArc0t1c Posted July 6, 2007 Share Posted July 6, 2007 Make a cookie on first visit, Because the client won't have teh cookie when they visit for the first time. The second time they come, they will have the cookie, thus they have been there before. Quote Link to comment Share on other sites More sharing options...
cluce Posted July 6, 2007 Share Posted July 6, 2007 Or you can create a field in your table called last_successful_login and record everytime the user logs on successfully with the NOW() function. example from my web page //record last login $sql2 = "UPDATE employees SET last_login=NOW() WHERE username = '$checkuser' LIMIT 1"; mysqli_query($mysqli,$sql2); Quote Link to comment Share on other sites More sharing options...
bbaker Posted July 6, 2007 Share Posted July 6, 2007 I have a community where there is a database table that has a first_login field that is empty by default. My script is set up so that when the user logs in, it queries the database to see if the first_login filed is empty, if so, it brings them directly to the page to change their password, then inserts the timestamp into the field. Thus, next time they sign in, they're directed to their default page. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.