user3274945
user3274945

Reputation: 25

Can't set header to text/css in php

header("Content-type: text/css");
echo 'sometext';
exit;

in my browser I still see the type text/html, why is that?

Upvotes: 0

Views: 79

Answers (1)

Sirac
Sirac

Reputation: 693

The comments already say it, but try to print/echo some real css-content. if your file is still detected as text/html, turn error-messaging on and see if there is a "headers already send"-warning, which indicates that your php-script echoed some whitespace before the header("...")-codeline.

Upvotes: 2

Related Questions