Content-type not working in PHP

后端 未结 13 2132
时光说笑
时光说笑 2020-12-09 12:16

I have some issues with a PHP file that is not working properly. The Content-type does not get recieved by any browser at all. Firebug interprets the file as text/html inste

13条回答
  •  独厮守ぢ
    2020-12-09 12:58

    You can try Content-Style-Type: text/css

    See the below from the here

    The default style sheet language may also be set with HTTP headers. The above META declaration is equivalent to the HTTP header:

    Content-Style-Type: text/css

    Edit:

    At the link , it's mentionned to add AddType text/css .css in the apache config file. Maybe you can give it a try

    Edit2 Look up for 'css' at this link. Someone had the same problem as you. Try sending the header without the charset

    I recently had a hair-threatening problem with Firefox and XHTML 1.0 transitional.

    It worked fine with other browsers, and also with HTML 4.1.

    To cut a long story short, PHP-generated JS and CSS files were still being reported by the headers as text/html, while in the HTML they were text/css and application/javascript; Firefox having been told the page was XHTML 1.0 became anal-retentive and refused to style the page. (I think the JS still worked but I fixed it anyway.)

    Solution:

    header('Content-type: text/css'); and header('Content-type: application/javascript');

    Edit 3 There was a post about some forms not submitting any data because of an utility called AVG Linkscanner. Since you have reinstalled Apache + php and I assume you didn't reinstall the OS, so you can maybe investigate on this/try by turning some utilities/plugs-ins off.

提交回复
热议问题