Forum Moderators: not2easy

Message Too Old, No Replies

CSS Styles from PHP file break Gecko browsers

A cry for help

         

Delphic

11:13 am on Dec 14, 2006 (gmt 0)

10+ Year Member



Hi,

I want to be able to use some PHP on my website to generate CSS, instead of using fixed .css files. This should enable me to fine tune for different browsers. But I have found that Firefox and Camino ignore the styles in the .php file, even if I use a full URL to reference it as in this line:

<link rel="stylesheet" type="text/css" href="http://www.example.com/styles.php" />

Safari, Opera and IE 7 all seem to manage. I have seen another site use this trick, and it looked all right. Any ideas?

Regards,

Mark

[edited by: SuzyUK at 11:19 am (utc) on Dec. 14, 2006]
[edit reason] examplied url [/edit]

DanA

11:23 am on Dec 14, 2006 (gmt 0)

10+ Year Member



Does your php file send the proper header?
header("Content-type: text/css; charset=iso-8859-1");

Delphic

11:47 am on Dec 14, 2006 (gmt 0)

10+ Year Member



Hey! Thanks, that did it.

I had no idea that was needed. I'm a bit of an amateur at this. I was blaming poor old FF. I can go to bed happy.

Thanks again!

Mark