Header Information Help.

Status
Not open for further replies.

lgpro01

New Member
Messages
9
Reaction score
0
Points
0
Hi

Could you please help me with this problem? I have tried everything they said to do on the internet but it still doesn't work.

Warning: Cannot modify header information - headers already sent by (output started at /home/lgpro01/public_html/index.php:14) in /home/lgpro01/public_html/index.php on line 147

Thanks

I tried to turn the HTML code in to a PHP string but it still says:

Warning: Cannot modify header information - headers already sent by (output started at /home/lgpro01/public_html/index.php:14) in /home/lgpro01/public_html/index.php on line 147


<?php include('config.php');
Print "
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<title>" . $PageTitle . "
</title>
<link href='default.css' rel='stylesheet' type='text/css' media='screen' />
</head>
<body>
<!-- start header -->
<div id='header'>
<div id='logo'>
<h1><a href='
"; <-- that is line 14
Print $TopH1Link . "'>";
Print $TopH1; ?>
 
Last edited:

jim7777

New Member
Messages
9
Reaction score
0
Points
0
try checking if header declaration has duplicated or a certain declaration has duplicated and try checking your syntax on that particular line
 

Gouri

Community Paragon
Community Support
Messages
4,565
Reaction score
245
Points
63
The "headers already sent" error is generally caused by white space before or after the opening and closing PHP tags (<?php ?>).

Check it out.

And also if you provide the script then we can check what is wrong with it. Remember to remove any sensitive information like passwords etc...
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
I have tried everything they said to do on the internet but it still doesn't work.
Everything? On the whole internet? Really?

Where is the call to header()? From the error message, you call header on line 147, but start outputting data on lines 2-14, which is the exact problem covered in many threads on this site and others.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
The header call must be the first thing that is sent to the browser. I would recommend moving it at the top of your page. If you cannot, then use output buffering throughout the whole page to make sure no content is sent before the headers are. http://ca2.php.net/manual/en/ref.outcontrol.php

- xav0989
 
Status
Not open for further replies.
Top