Re: php redirection..

From: Date: Sat, 16 Dec 2006 04:28:39 +0000
Subject: Re: php redirection..
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-245889@lists.php.net to get a copy of this message
Actually... Search engines don't have a JavaScript interpreter. On 12/15/06, Richard Lynch <ceo@l-i-e.com> wrote:
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


« previous php.general (#245889) next »