hello i have my header externally here i wanted to add a php script so that the role can be queried in the database. I see the header on every page but the php script only doesn't work in the header if I put the script on the page it works can someone help me here?
function template_header($title) {
echo <<<EOT
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1">
<title>$title</title>
<link href="style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css">
</head>
<body class="loggedin">
<header>
<h1>DaKo Website</h1>
<a class="responsive-toggle" href="#">
<i class="fas fa-bars"></i>
</a>
</header>
<nav class="navtop responsive-width-100 responsive-hidden">
<div>
<h1>DaKo Website Status: <?=$usrrole?></h1>
<a href="home.php"><i class="fas fa-home"></i>Home</a>
<a href="profile.php"><i class="fas fa-user-circle"></i>Profile</a>
<?php if($usrrole == 'Admin'):?>
<a href="admin/index.php" target="_blank"><i class="fas fa-user-cog"></i>Admin</a>
<?php endif;?>