search

Home  >  Q&A  >  body text

How to write user logout?

So how do you use PHP to delete the username and password in the database by logging out?

skyblue°天空skyblue°天空2434 days ago1654

reply all(4)I'll reply

  • 嘉俊

    嘉俊2018-05-04 14:34:26

    What does the so-called user logout mean?

    One is to log out by clicking the exit button on the user login page; //Directly use unset($_SESSION['user']), session_destroy();

    The other is for the administrator to log out in the background Disable a user from logging in; //Modify the value of the data table field, such as status => 0, 0 means disabled, and the default is 1.

    The last one is for the administrator to directly delete a user's information. //Just use delete from.

    I hope I can help you.

    reply
    0
  • 进击的蜗牛

    进击的蜗牛2018-05-01 11:54:37

    When logging out of a user, there is no need to delete the user information in the database. It is OK to just clear the user information saved in the session (generally) when logging in.

    reply
    0
  • 海东

    海东2018-04-28 11:01:51

    Destroy$_SESSION

    reply
    0
  • Daniel

    Daniel2018-04-28 08:52:22

    The user name and information entered by the user are compared with the database. After success, they can be stored in the session super global variable and session_destroy()

    when logging out.

    reply
    0
  • Cancelreply