RE: [PHP] redirect using header
| From: | Chris Shiflett | Date: | Thu, 27 Mar 2003 21:34:50 +0000 |
| Subject: | RE: [PHP] redirect using header | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141320@lists.php.net to get a copy of this message | ||
--- David Banning <david@skytracker.ca> wrote:
> I have been trying to do a redirect with header;
...
> I keep getting the error;
>
> Warning: Cannot modify header information - headers already sent by
> (output started at /usr/hosting/optex/goterm/temp.html:8) in
> /usr/hosting/optex/goterm/temp.html on line
--- Jeremy Russell <Jeremy.Russell@chickasaw.net> wrote:
> Use ---> header("Location:http://newwebpage.com");
Technically, the syntax for the header is (notice the space after the colon and
the proper URL):
header('Location: http://newwebpage.com/');
Also, while his syntax is a problem, it is not the problem at hand. David, you
cannot have output prior to using the header() function. You need to call
header() prior to outputting your HTML.
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/