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