Jump to content

Recommended Posts

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;?>

Untitled.png

Link to comment
https://forums.phpfreaks.com/topic/315098-need-help-with-extern-header/
Share on other sites

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.