开发者

CSS generated via PHP ignored in Firefox but works in Chrome, IE8

开发者 https://www.devze.com 2022-12-19 17:07 出处:网络
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

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=开发者_Python百科"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?


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');


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号