Jump to content

header errors


Recommended Posts

i noticed that if i use headers for content-type/charset i get error message.

 

my test file is:

<?php
header('content-type: text/html; charset=utf-8');
?>

 

and result is error

Warning: Cannot modify header information - headers already sent by (output started at /******/public_html/test.php:1) in /*****/public_html/test.php on line 1

 

so do i need to edit my php.ini  to make these headers work?

Link to comment
https://forums.phpfreaks.com/topic/187171-header-errors/
Share on other sites

If that is the actual error message, without output started on line 1 of the file and there are no actual characters before the <?php tag, then you file has been saved with the UTF-8 BOM (Byte Order Mark) characters and you would need to save it without the BOM.

Link to comment
https://forums.phpfreaks.com/topic/187171-header-errors/#findComment-988387
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.