Q:

Change background color of a PHP include on different pages? 

We are making a website for a school project and we help with some (simple) PHP. 
We got a website with 4 pages, we are using includes for the header/navigation.  But we want different background colors for our pages, but if we change the color, the color is going to be changed on all the sites because we use includes. 
This is an example of a page:
<? php   
        $pagetitle = "Forside";
        require_once("includes/header.inc.php");
? >

###SOME CONTENT FOR THIS PAGE###

<? php   
        require_once("includes/footer.inc.php");
? >

We want to change the color of the < body > tag which is inside in "includes/header.inc.php"
But as I said if we change that color, the color is changed on all the pages where we use the header include. 
Is it possible to change this with some PHP? 
Our navigation is pretty simple it can bee seen here:
<nav id="menu">
        <a href="./index.php"><img class="navigation" src="./img/forside-billede.png" /></a>
        <a href="./gaestebog.php"><img class="navigation" src="./img/gaestebog-billede.png" /></a>
        <a href="./citater.php"><img class="navigation" src="./img/citater-billede.png" /></a>
        <a href="./koncept.php"><img class="navigation" src="./img/koncept-billede.png" /></a>
    </nav>

Please write if you need any more information in order to help us or if you dont understand our problem.  Thanks in advance!  

A:

You can set the color on each PHP file before you include the header.  Then you can use that PHP variable in css in the header.inc.php
<? php   
        $pagetitle = "Forside";
        $bodyColor = "#ff0000";
        require_once("includes/header.inc.php");
? >

###SOME CONTENT FOR THIS PAGE###

<? php   
        require_once("includes/footer.inc.php");
? >

If the css is between your header tag you can do something like this in your css:
....
....
body {
    background:<?=$bodyColor;? >;
}
....
....

If it isn't you could use the style attribute, e.g.:
....
....
<body style="background:<?=$bodyColor;? >;">
....
....

