Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php headers already sent error [duplicate]

Tags:

php

header

Possible Duplicate:
Headers already sent by PHP

I have a single php file, with this code in it:

<?php header("Location: somepage.php"); ?>

Absolutely no spaces before or after the php opening or closing tags and I am getting the

Warning: Cannot modify header information - headers already sent by (output started at C:\ ... \test.php:1

Usually when I get this error, the 1 is the line number of the problem, but in this case line one doesn't have any extra whitespace. I only have this code on the page and I am not including any other files.

I'm using xampp on windows xp. Any ideas what's going on or how I can track down what's really causing the problem.

Thanks

like image 605
Joe Avatar asked Dec 23 '22 01:12

Joe


1 Answers

Chances are that you have what's known as a BOM (Byte Order Mark) in the file. Depending on what editor you're using, you'll need to turn off adding the BOM...

like image 73
ircmaxell Avatar answered Dec 24 '22 15:12

ircmaxell