Possible Duplicate:
PHP Fix Warning: Cannot modify header information - headers already sent
“Warning: Headers already sent” in PHP
I had a nice website that worked perfectly. The first page is header.php and the first line was:
<?xml version="1.0" encoding="utf-8"?>
Then one day it started to say parse error line 1. So I did some research on the web and changed the first line into this:
<?php echo '<?xml version="1.0" encoding="utf-8"?>' ?>
And the parse error problem vanished. But then another problem appeared:
Warning: Cannot modify header information - headers already sent by (output started at /Volumes/raid/Web/Sites/*******.com/header.php:1)
So I decided to remove this first line from the code (and to be honest I had no idea what was it's purpose). Then a new error appeared :
Warning: Cannot modify header information - headers already sent by (output started at /Volumes/raid/Web/Sites/*******.com/header.php:25)
And here's the code where I can't find any error (no blanks at end of lines, for sure)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-transitional.dtd">
<html lang="fr" dir="ltr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<link type="image/x-icon" href="./img/lions_icon" rel="icon">
<link type="image/x-icon" href="./img/lions_icon" rel="shortcut icon">
<link href="/css/jquery.ui.all.css" rel="stylesheet">
<title>Lions</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<script src="/js/jquery.js"></script>
<script src="/js/jquery-1.8.2.js"></script>
<script src="/js/jquery.ui.core.js"></script>
<script src="/js/jquery.ui.widget.js"></script>
<script src="/js/jquery.ui.datepicker.js"></script>
<script src="/js/bootstrap.js"></script>
<script>
$(function() {
$( "#date" ).datepicker();
$( "#date" ).datepicker( "option", "dateFormat", "yy-mm-dd");
});
</script>
</head>
<?php
// beggining of the php code,
....
?>
<body>
...
The line 25 is the one where the php begins.