|
Posted by "Richard Lynch" on 10/07/05 23:41
On Thu, October 6, 2005 9:37 am, Robert Cummings wrote:
>> > when I add that code I can the following error msg when submitting
>> the
>> > form.
>> > " *Warning*: Cannot modify header information - headers already
>> sent by
>> > (output started at /home/webadmin/dedicated75.virtual.vps-
>> > host.net/html/fortuneInteractive/Consultation_test.php:6<http://host.net/html/fortuneInteractive/Consultation_test.php:6>
>> > <http://host.net/html/fortuneInteractive/Consultation_test.php:6>)
>> > in */home/webadmin/dedicated75.virtual.vps-
>> > host.net/html/fortuneInteractive/Consultation_test.php<http://host.net/html/fortuneInteractive/Consultation_test.php>
>> > <http://host.net/html/fortuneInteractive/Consultation_test.php>
>> > * on line *168* "
>> > line 168 is the one with header( 'Location: thanks.php' );
>> > on it.
>> > can anyone explain why this is happening and how to rectify?
A long time ago, this error message would only have told you that the
line 168 was "wrong" and that data had already been sent earlier.
Now, however, buried in this error message, is the EXACT LINE of code
where the data was already sent:
/home/webadmin/dedicated75.virtual.vps-host.net/html/fortuneInteractive/Consultation_test.php:6
Line 6, of Consultation_test.php is the culprit.
WARNING:
Emacs, by default, on some system, will automatically ADD a newline
character at the end of any file you edit.
In older versions of PHP (possibly pre-dating this error message) that
would be problematic. It may STILL be problematic for all I know. I
don't use Emacs, but recall the grief it caused many a PHP beginner
from long ago on the list.
Disclosure:
I may have been the first/loudest to request that the original line of
data output be logged by PHP internally so that this message could
inform you of this fact. Hell, for all I know, I'm the only guy that
asked for it. Oh well. It's there. Use it.
--
Like Music?
http://l-i-e.com/artists.htm
[Back to original message]
|