This is a discussion on "Cannot modify header information - headers already sent" within the PHP Forum section. This forum, and the thread "Cannot modify header information - headers already sent are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Cannot modify header information - headers already sent
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Hi,
What does this mean exactly? Cannot modify header information - headers already sent My site was working with no problems at all when i was developing it on the local server but once i uploaded it to the internet server the above error message appears when i use the function below. header("Location: home.php"); Any help would, as always, be gratefully recieved! |
|
|
|
#2
|
|||
|
|||
|
Re: Cannot modify header information - headers already sent
Is there anything sent to the browser before the header? because thats what normaly gives that error, a echo, any white space or text outside of the <?php ?>
|
|
#3
|
|||
|
|||
|
Re: Cannot modify header information - headers already sent
Quote: "Note: The HTTP status header line will always be the first sent to the client,.........."
php.net Always FIRST after open tags .. - remember this and have no more problem with HTTP protocol level Example <?php header(.................. Regards www.take-host.com |
|
#4
|
|||
|
|||
|
Re: Cannot modify header information - headers already sent
Ok, so how should I do an automatic redirect? Also why was it working on my local machine but not when the file was uploaded to the internet?
|
|
#5
|
|||
|
|||
|
Re: Cannot modify header information - headers already sent
Not sure, need to see some code to figure out exactly what is wrong...
|
|
#6
|
|||
|
|||
|
Re: Cannot modify header information - headers already sent
Some example again i will quote same page:
"<?php header("Location: http://www.example.com/"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit;?>" Good luck www.take-host.com |
|
#7
|
|||
|
|||
|
Re: Cannot modify header information - headers already sent
RE your post on headers already sent---
"Ok, so how should I do an automatic redirect? Also why was it working on my local machine but not when the file was uploaded to the internet?" im having the same problem - how did you solve your "headers already sent..." but works on local machine? Driving me nuts!!!! David david@mypilot.org |
|
#8
|
|||
|
|||
|
Re: Cannot modify header information - headers already sent
Ok heres how to solve the problem.
At the beginning of the page. before any HTML or any code is written type:
The function buffers all information between it before sending it to the browser. |
![]() |
| Tags |
| cannot, modify, header, information, headers, already, sent |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Headers | alexgeek | Search Engine Optimization (SEO) | 2 | Jul 7th, 2008 09:08 |
| Modify the DOM? | gustaf | JavaScript Forum | 1 | Sep 19th, 2007 23:01 |
| 3 choices 3 headers | saltedm8 | Graphics and 3D | 12 | Jun 24th, 2007 09:26 |
| Form headers appearing bold | Freddie | PHP Forum | 1 | Dec 20th, 2005 14:26 |
| Cannot modify header information - headers already sent | Tim356 | PHP Forum | 2 | Aug 7th, 2005 22:58 |