Re: php redirection..
| From: | Richard Lynch | Date: | Sat, 16 Dec 2006 02:49:31 +0000 |
| Subject: | Re: php redirection.. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-245886@lists.php.net to get a copy of this message | ||
On Tue, December 12, 2006 12:51 pm, Stut wrote:
> bruce wrote:
>> hey stut...
>
> Please don't reply to me directly, always include the mailing list.
>
>> thanks for the reply... i did get some output...
>>
>> i also have a question as to why i couldn't get it to work when i
>> used
>> 'header (foo.php)'
>
> 1) The correct way to redirect using the header function is
> header('Location: http://domain.com/foo.php'); Note
> the absolute URL.
> 2) Using header will definitely not display any output from the page.
You actually need to put in an exit; if you want to guarantee that PHP
won't send more data, and that the browser won't process it and show
it before doing the re-direct...
*MOST* of the time the Location: header gets processed so fast, you
don't see any following data, but if you pound on it enough, you'll
see that the browser *can* show the data after the re-direct, if it
feels particularly Orange at that moment in time.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?