Re: php redirection..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux