I have a globals.php
file included in every file on my site. I'd like to include on this file a CSS
file globals.css
.
The problem is that if I add the CSS in globals.php
and then include it on all file, I get some errors like:
Warning: session_start() [function.session-start]:
Cannot send session cache limiter - headers already sent (output started at /...)
in /... on line 4
or when using
header('Location: ....');
Is there a better-more appropiate solution than using ob_start
at the top of globals.php
and ob_end_flush
at the bottom of the same file, or is this method the right way to operate?
globals.php
<?php
ob_start();
//some costants and functions
?>
<head>
<link href="/css/globals.css" rel="stylesheet" type="text/css">
</head>
<?php
ob_end_flush();
?>