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
Instead of a button, put a link and navigate it to another page
Logout
Then in logout.php page, use
logout.php
session_start(); session_destroy(); header('Location: login.php'); exit;