logout php html code example
Example 1: logout in php
<?php
if(isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['uname']);
header('location:login.php');
}
?>
Example 2: logout in php
if(isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header('location:login.php');
}