I agree and have made a similar comment before. There are
circumstances where it's desirable to take complete responsibility for
generating the full HTTP response including headers, but there's
currently no way of turning everything off. I hit against this problem
when doing R&D into a WebDAV implementation. In the end I had to
abandon the use of PHP as a gateway technology which was a great pity.
It seems that PHP adopts the "nanny knows best" attitude and assumes
responsibility in this area.
Rob
On 21 Mar 2004 21:36:13 -0800,
ng4rrjanbiah@rediffmail.com (R. Rajesh
Jeba Anbiah) wrote:
[color=blue]
>John Wellesz <john.wellesz-N0-SPAM-OR-BCURSED@firstream.net> wrote in message news:<Xns94B1C9E45C1B2Lord2072@213.91.2.138>...[color=green]
>> Hello,
>>
>> It would be great if there was an option to tell PHP to let the user
>> manage all the HTTP headers instead of sending what it thinks is good for
>> the programmer...
>>
>> For example when you write:
>>
>> header("Status: 200 OK");
>> header("Location: /my_internal_redirected_page.php");
>>
>> PHP "decides" that the status will be "302 moved", ignoring the "Status:
>> 200 OK" (ie: the programmer is stupid)...
>>
>> I use PHP as a cgi along with mod_fastcgi, when fastcgi sees a relative
>> redirection with a "200 OK" status it autaumatically do an internal
>> redirection (very useful in some cases, to hide a file url for example).
>>
>> Well, in PHP 4.3.4, the only way I found to achieve this was this
>> wonderful trick:
>>
>> header("Location: /my_internal_redirected_page.php");
>> header("HTTP/1.0 200 OK");
>>[/color]
>
> Sounds like you're referring the user notes by ahring.de
>(02-Dec-2003 09:24) found at <http://in.php.net/header>
>
> In that case, the following is working fine:
>
><?php
>header("Location: http://www.google.com");
>header("Status: 200");
>?>[/color]
---
Rob Tweed
M/Gateway Developments Ltd
Global DOMination with eXtc :
http://www.mgateway.tzo.com
---