Reply to Re: headers sent issue

Your name:

Reply:


Posted by Jerry Stuckle on 12/17/48 11:55

Mladen Gogala wrote:
> On Sun, 13 Aug 2006 20:38:11 -0400, Jerry Stuckle wrote:
>
>
>>PHP isn't broken. It shouldn't have output buffering by default - no
>>other language does, for instance. And doing so would break other
>>applications which depend on immediate output.
>
>
> Actually, all Unix and Unix-like systems have both input and output
> buffering turned on by default. That's what system buffers are all about.
> If you want to bypass them, you have to do something called "direct I/O".
> Buffering on Unix-like systems is a fact of life and it isn't language
> dependent.
>

But PHp is not a system. It's a programming language. Apache still
buffers the output. And as soon as ANY output is sent - whether from
PHP, PERL, HTML or whatever - Apache sends the headers.

>
>>And BTW - it doesn't even have to be PHP which causes the output to be
>>sent. A space or new line character before the first "<?php" is enough
>>to do it. And PHP isn't even involved.
>>
>>
>>>I've had pages working without a hitch on Linux or Solaris and
>>>reporting "headers already sent" on Windows 2000.
>>
>>I rest my case. If they were coded properly you wouldn't have that problem.
>
>
> Call to ob_start() resolved the issue extremely quickly. This also breaks
> your argument, for if it was a protocol problem, it would be a protocol
> problem on both systems. Network protocols are, by definition, independent
> of the operating system.
>

Sure, You're getting around the real problem.

And it doesn't break my argument at all. ob_start() just tells PHP to
do some buffering. It doesn't fix your problem at all. Just bypasses
it - for now.

>
>
>>>Your "solution" is like dieting by
>>>maniacally counting calories - it seldomly works and usually creates more
>>>problems then it solves.
>>
>>Nope. It solves ALL the problems. And it doesn't artificially hide the
>>problems cause by poor coding practices.
>
>
> With the exception of the ease of programming and the speed of getting
> things done. In addition to that, if you call something "poor coding
> practices", you should explain why do you think that and what evil can
> come out of following those "poor programming practices".
>

And if you don't have the time (or inclination) to do it right - when
will you have the time (or inclination) to do it over?

And I tried to explain to you. But you're obviously not willing to
understand.

>
>>>Calling header() is not an unusual request, it's
>>>like calling a subroutine to jump to another page.
>>
>>Agreed.
>>
>>
>>>I couldn't care less if
>>>headers are already sent. I just want another page, period.
>>
>>If you were a real programmer, you WOULD care about whether the headers
>>have been sent or not.
>
>
> And why exactly would I care about that? You didn't come up with any
> arguments so far, only with unprovoked personal insults.
>

I've already tried explaining it to you. You're not fixing the problem.
You're bypassing it. Sooner or later you're going to run into
problems - like when you're on a different OS, maybe a different version
of PHP which buffers differently, or even expect the headers to have
already been sent when you're doing something in your code.

All kinds of things can happen. And it's not at all difficult to fix
the real problem.

>
>
>>>I'm a DBA, programming is not my primary business.
>>
>>That explains a lot. Might I suggest you stick with DBA work and let
>>programmers do the programming?
>
>
> Might I suggest you to refrain from unsolicited career advices? The
> difference among us is that you think that there is something to be gained
> by catching that fateful space or newline before "<?php" and I don't. I am
> not at all opposed to alleviating the pain by inserting <?php ob_start()?>
> as the very first line of my php scripts and forget about headers. I
> haven't had the case of that biting me later and you haven't explained how
> will that byte me later. You did get quite personal which discourages me from
> continuing the debate. My scripts and programs do work, are written quite
> clearly and are quite easy to maintain. I'm maintaining them for years.
> This is the point at which I will shrug my shoulders, direct you to some
> "real programmers" jokes at:
> http://www.jestsandjokes.com/show.php3?joke=171
>

Nope, you post in this forum and you might get some advice - whether you
want it or not.

And you're the real joke here. I'm glad real programmers find the
problem - instead of making a "quick fix". The quick fix never is - in
the long run.

> and terminate it gracefully with EOD. You may believe that Allah told you
> how to program but I subscribe to the other gods. May the farce be with
> you, my friend.
> ....
>
>
>>And so can stupid and asinine programming practices.
>>I hope you don't have such a cavalier attitude towards your DBA work as
>>you do programming. If so, I pity your employer."
>
>
> You must be a joy to work with. Your employer probably fully deserves you,
> just for giving you "your team".
>

Actually, I'm a consultant. I have my own business. And quite in
demand, also. Enough that I regularly turn down work.

But that's because my customers know their projects are done on time,
within budget - and right.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация