Q:

php Content-type: text/css not working

I have a style.css:
<link href="/file.css" rel="stylesheet" type="text/css" property='stylesheet'/>

#menu{
 background:red; //file.css content
}

and after that a php:
<link rel='stylesheet' type='text/css' href='/color.php' />

//color.php content:

header("Content-type: text/css", true);
include_once("mysqli.php");

session_start();
 $userid=$_SESSION['id'];

 $stmt = $mysqli_link->prepare("SELECT site FROM cores where user=? limit 1");
 $stmt->bind_param('i', $userid);
 $stmt->execute();
 $stmt->bind_result($color);
 $stmt->fetch();
 $stmt->close();

if($color=="blue"){
    $m="blue";
}
else if($color=="green"){
    $m="green";
}

echo"
#menu{
    background-color:$m;
}
";

If I open the color.php it prints well the colors. but in the page it is not overwritten the style.css #menu red color. What is wrong? any help?
thank you friends!

A:

Try to change the order of your first lines like this :
session_start();
include_once("mysqli.php");
header("Content-type: text/css");

The Content-type can be overrided by the script you are including (mysqli.php).
Also, a "session_start" should be ALWAYS the first thing you do in a php script that uses sessions. (The reason why I put session_start() in first position)

