Re: Re: Does Location: headers constantly
| From: | Richard Lynch | Date: | Thu, 04 Jul 2002 22:33:50 +0000 |
| Subject: | Re: Re: Does Location: headers constantly | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-105530@lists.php.net to get a copy of this message | ||
>> I can't let this go unchallenged -- what happens if you're sending this to a
>> browser which *doesn't* honour the "Location: " header, but *is* capable of
>> displaying any attached page content? The poor user will be left with a
>> completely blank screen, and no hint of why. In fact, the HTTP/1.1 spec
>
>But, which browser is incapable of handling location headers?
I think Netscape 1.x didn't... I'm pretty sure Netscape 2.x did support
Location headers. At least, that's my recollection of their behaviour.
Now, find me an actual user who is really *using* Netscape 1.x... :-)
There might be some really stupid search engines that don't, but no human
will see the text anyway... I suppose a *really* stupid search engine could
ignore the headers and parse the HTML... :-)
By all means, if you have valid HTML that you want to send just in case they
are using Fred's Browser that doesn't handle Location headers, do so.
I only meant that you shouldn't have stupid code that sends the rest of your
HTML that's just sort of sitting there after your Location:, and that
Cookies are just not going to work:
----------- bad code ------------------------------------
<?php
if (!valid_user()){
header("Location: http://www.example.com/login.htm");
}
?>
Secret information here.
---------------------------------------------------------
I don't know really care what the RFC's say -- I know what *WORKS* in the
browsers. Alas, the browser developers are racing each other to release,
and they ain't reading the RFC's either. :-(
Maybe the RFC's say that Cookies should work. They don't work. Sorry.
When the W3C starts promulgating standards that are actually *IMPLEMENTED*
*RELIABLY*, I'll start paying more attention to them. Meanwhile, I'm coding
for the actual behaviour of the browsers in use:
Netscape/IE version 3 through 6 (7?), Opera, Mozilla, and Lynx. No CSS. No
layers/DHTML. Minimal JavaScript for roll-overs. No Flash.
I dropped support for version 2 browsers only last year or so when a client
dumped her 486 (386?) and got a new laptop... That was a relief.
If you want challenges in supporting obsolete systems, try building
web-sites for starving artists. They use the hardware their day-jobs throw
away :-)
>> (RFC 2616:
>> http://www.w3.org/Protocols/rfc2616/rfc2616.html) even says:
>>
>> > Unless the request method was HEAD, the entity of the response
>> > SHOULD contain a short hypertext note with a hyperlink to the
>> > new URI(s).
>
>Oddly, I don't find that text you excerpted on the URI you provided.
>
>But, the thing is, I'm under the impression that PHP (and/or Apache?)
>doesn't send anything else from your script once a Location header is
>sent. I just confirmed this with two different tests.
Maybe RFC 2616 got changed?...
I dunno. Or care. For browsers, I have to work with reality, not RFC's.
I sure *wish* they matched up, like they do for most other things (or pretty
close, anyway) but they don't.
--
Like Music? http://l-i-e.com/artists.htm