2

I have some forms in webpage. The forms are generated by a CMS component. The styling of the forms is set through a template_css.php file, which facilitates the dynamic styling given a form's variables.

In my local environment, the file is loaded fine, and the css renders as expected. But in public server, the css is not rendered and I get the following warning from Chrome debugger:

Resource interpreted as Stylesheet but transferred with MIME type text/html: ...filepath

What can I do to force this file to be read as CSS even though is a PHP file?

Thank you

IberoMedia
  • 2,226
  • 7
  • 36
  • 61

2 Answers2

8

You want to set the header to text/css:

<?php header("Content-type: text/css"); ?>

David
  • 2,053
  • 2
  • 16
  • 26
1

I suspect your public server is specifying the mime type for php files. If apache see mod_mime for details.

scottlimmer
  • 2,230
  • 1
  • 22
  • 29