Forum Moderators: coopster
it's a somewhat exotic topic but maybe someone can hint me in the right direction. Here's my problem:
I want to import a dynamically created stylesheet which of course is generated in a PHP script. Within this script the following happens:
***************************************
include_once("someclass.php");
header("Content-Type: text/css");
$myobj= & new obj;
$css = $myobj->getCSS();
/*Just to test if it works at all I use these lines
$css = 'body {
background-color:silver;
}';
*/
echo $css;
**************************************
Everything works fine as long as I do not initalize my object (which has a couple of parent objects).
It seems the initialization process of chained constructors screws up the header information. First I thought that may be something is outputting some PHP warning or a notice but I think I ruled that out....
Can anybody provide any information about this?
I know that I could probably work my way around it, but it would be beautiful if I was able to achieve it this way.
Thanks for your help,
Stefan
include_once("someclass.php"); isn't producing any output, is it? Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called.