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
This is usually caused by a fatal error (ie, syntax error) that causes the script to abort before any of the code is execute (before display_errors can be set through ini_set() at runtime). Try changing display_errors in the php config file (php.ini).
Looks perfectly ok and the line with the echo
should definitely generate a warning. Could it be that you're editing the wrong file?
the reason is because the header
function works only if it is the first one to be called!
If you put an echo
before, the content type automatically becomes text/html
try to print a CSS code after the header to test if it actually works.
Read this page for more infos
EDIT: did you change your post ? :-)
Check your php.ini file for the output_buffering setting. If it's not set to "off" than PHP is automatically doing output buffering for you. Set that to off and echo something before the header command, and you should see the "classic error".
You shouldn't use the closing ?>. I know this is a controversial suggestion, but too many times people add a return and/or space after it, which gets output to the browser (before the header). There are very few cases where it not using it would cause a problem.
Wild guess : open your file with something which would display any BOM. If you see some strange characters before <?php
you have your problem. Check your current editor options to save UTF-8 file and make it save them without BOM.