Re: PHP - REDIRECTION

From: Date: Tue, 11 Mar 2014 13:12:01 +0000
Subject: Re: PHP - REDIRECTION
References: 1 2 3  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-18458@lists.php.net to get a copy of this message
Ansego wrote: > The header has to be at the top of the page? Not necessarily. header() has just to be called before any output is sent. > why not call it redirect? Probably because the Location header is part of HTTP[1], and actually, the redirect is not done by PHP, but by the client. If you prefer to call redirect($url) nonetheless, you can easily define your own function: function redirect($url) { header('Location: '. $url); // further arguments as desired } BTW: the webmaster mailing list is probably not the appropriate place for such requests/discussions[2]. [1] <https://tools.ietf.org/html/rfc2616> [2] <http://www.php.net/support.php> -- Christoph M. Becker

« previous php.webmaster (#18458) next »