Re: [PHP-DEV] PHP 4.0 Bug #8552 Updated: fopen doesn't open URL From: Stig Venaas (Stig.Venaas <email protected>)
Date: 01/05/01

On Fri, Jan 05, 2001 at 07:05:25PM +0100, Cynic wrote:
> At 18:30 5.1. 2001, Zak Greant wrote the following:
> > Perhaps it would be good to throw a notice level error when handling
> > redirects - redirects are often put into place when a resource has
> > moved. If PHP handles them perfectly transparently, then the site
> > admin may not know that a resource has moved til the redirect is
> > removed.
> >
> > --zak
> ------end of quote------
>
> In that case, I would like the notice mechanism be done so
> that it's easy to get the server response code... BTW, what
> would happen if server returned 300 (Multiple Choices)?

The way it is now, a script could check the contents of
$http_response_header and do a redirect on it's own, it would be
easier for the user, and the right thing in most cases, to follow the
redirect I think. I agree that one should be able to see the response
code. It seems reasonable that $http_response_header is the header for
the final location, but we could in theory also put the header of the
first location (possible several with a chain of redirects) in there.
I'm not sure.

Might be nice if one could specify if one want to follow redirects or not,
but I don't really see a nice way to specify it. One could have some extra
code in the mode string which seems bad, or we could say that the optional
include_path parameter denotes whether to follow redirects since
include_path doesn't make sense for HTTP URLs anyway. If we do this, I
still think we should follow by default which also seems to be the
behavior in PHP3 and up to 4.0.2.

Stig

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>