This was working in php7 the service provider upgraded to php8, the code stopped working,
<?php
session_start();
setlocale(LC_MONETARY, 'en_IN');
date_default_timezone_set('Asia/Kolkata');
include "../fdms/config.php";
$staffname = $_SESSION['staffname'];
$staffname=ucfirst($staffname);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="css/comp.css" type="text/css" />
<link rel="stylesheet" type="text/css" media= screen and (max-width:800px) href="../css/mobile.css">
</head>
<header class="header">
<li style='text-align: right; padding:5px;'>Logged In User:<?php echo $staffname?> </li>"
<form action="" method="POST">
<button style="width:auto; background:brown" name="option" value="HOME" >Notice </button>
<button style="width:auto; background:orange;" name="option" value="COMP">Complaints</button>
<button style="width:auto; background:green;" name="option" value="ATTE">Attendence</button>
<button style="width:auto; background:blue; " name="option" value="LOGOUT">Logout</button>
</form>
</header>
<div style='text-align: right; padding:5px; color:whitesmoke; 'id="date_time"></div>
<script type="text/javascript" src="javascript.js"></script>
<script type="text/javascript">window.onload = date_time('date_time');</script>
<?php
$userlevel = $_SESSION['user_level'];
if(!isset($userlevel)) {
header('Location:login.php');
exit();
}
$option=$_POST['option']=' ';
if($option==='HOME') {header("Location:notice.php");}
if($option==='COMP') {header("Location:complaint.php");}
if($option==='ATTE') {header("Location:attendence.php");}
if($option==='LOGOUT') {header("Location:logout.php");}
?>