DaKo123 Posted July 28, 2022 Share Posted July 28, 2022 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;?> Quote Link to comment https://forums.phpfreaks.com/topic/315098-need-help-with-extern-header/ Share on other sites More sharing options...
ginerjm Posted July 28, 2022 Share Posted July 28, 2022 2 minutes ago, DaKo123 said: 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? This paragraph makes no sense to me. Could you write it a bit more properly so it makes some sense? Quote Link to comment https://forums.phpfreaks.com/topic/315098-need-help-with-extern-header/#findComment-1598695 Share on other sites More sharing options...
mac_gyver Posted July 28, 2022 Share Posted July 28, 2022 37 minutes ago, DaKo123 said: function template_header($title) { you should supply an associative ARRAY of ALL the data needed for the template. Quote Link to comment https://forums.phpfreaks.com/topic/315098-need-help-with-extern-header/#findComment-1598700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.