tags:

views:

59

answers:

2

Hello

i have a weird problem where css generated via php (stuck with a weird cms from an even weider programmer) is ingored by firefox 3.X and probably earlier. But the page loads ok in other browsers like IE7/8 and chrome. Also firebug doesn't see the css either but when i point my browser to the php-css-generation script it show me a plain page with css code

<link rel="stylesheet" type="text/css" href="app/style.php?PageID=224&Admin=">

does anybody know where should i look for some answers or how to possibly fix this? Could there be a problem with that "&Admin=" part?

+5  A: 

The most likely cause is that you are using PHP's default Content-Type output of text/html so Firefox thinks:

This is a stylesheet written in HTML, a stylesheet language I don't understand and will therefore ignore.

The other browsers are, presumably, compensating for the error.

Add:

header('Content-type: text/css');
David Dorward
tried and it doesn't change anything...
Gabriel
the "header" should go right at the top of the script right? because looking at firebug i'm allways getting "Content-Type text/plain;charset=windows1250"
Gabriel
I presume you added this to the top of `style.php`? **Edit:** yes, of course you should :)
BalusC
yes i added... but there was an error on my side where firefox fetched the page from the cache ... now i'm getting the right headers but the css is still ignored by firefox and even firebug doesn't see anything
Gabriel
i used "header('Content-type: text/css; charset=utf-8');" and it works. Thank you very much
Gabriel
A: 

What do you see if you make a direct request (e.g. via your web browser) for app/style.php?PageID=224&Admin= ? Can you debug the response using Firebug?

Bobby Jack
i see the css code...
Gabriel