ts2000abc Posted January 4, 2010 Share Posted January 4, 2010 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 More sharing options...
trq Posted January 4, 2010 Share Posted January 4, 2010 so do i need to edit my php.ini to make these headers work? No. You cannot send headers after data has already been sent to the client. Its all covered in this sticky topic contained within the PHP Coding Help board. Link to comment https://forums.phpfreaks.com/topic/187171-header-errors/#findComment-988375 Share on other sites More sharing options...
ts2000abc Posted January 4, 2010 Author Share Posted January 4, 2010 No. You cannot send headers after data has already been sent to the client. header() is the only line in this test file. so there is no html before (or even after) it. Link to comment https://forums.phpfreaks.com/topic/187171-header-errors/#findComment-988381 Share on other sites More sharing options...
PFMaBiSmAd Posted January 4, 2010 Share Posted January 4, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.