Logout button php

前端 未结 2 1865
甜味超标
甜味超标 2021-02-01 10:18

I have this code and need the code to add a logout button, can anyone write out the code for a log out button that will log out the user, I read something about destroy session

2条回答
  •  长情又很酷
    2021-02-01 10:50

    Instead of a button, put a link and navigate it to another page

    Logout
    

    Then in logout.php page, use

    session_start();
    session_destroy();
    header('Location: login.php');
    exit;
    

提交回复
热议问题