<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Register Login and Logout User</title>
<link rel="stylesheet" type="text/css" href="Style.css">
</head>
<body>
<div class="header">
<h1> Register, Login and Logout user php mysql</h1>
</div>
<?php
if (isset($_SESSION['message'])){
echo "<div id='error_msg'>" .$_SESSION['message']. "</div>";
unset($_SESSION['message']);
}
?>
<h1>Home</h1>
<div><h4>Welcome <?php echo $_SESSION ['username']; ?></h4></div>
<div><a href="Logout.php">Logout</a></div>
</body>
</html>
This is my code how can I fix it
Notice: Undefined index: username in C:\xampp\htdocs\authentication\Online Catering Reservation System.php on line 29