Jump to content

Fisrt time login


Recommended Posts

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);

Link to comment
https://forums.phpfreaks.com/topic/58686-fisrt-time-login/#findComment-291148
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/58686-fisrt-time-login/#findComment-291151
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.