Re: http header

From: Date: Mon, 26 Apr 2004 13:44:02 +0000
Subject: Re: http header
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-184637@lists.php.net to get a copy of this message
Torsten Roehr wrote:
"Gabe" <ydnahg-news4432@mailblocks.com> wrote in message news:20040416194831.92521.qmail@pb1.pair.com...
Is the following code the best way to redirect someone to a different page using PHP? <?php header("Location: http://www.yahoo.com"); ?>
From personal experience I can recommend putting "exit;" behind a header() redirect to absolutely make sure that no code is executed afterwards in the script: header("Location: http://www.yahoo.com"); exit; Without "exit;" the header redirect soemtimes didn't work for me. Regards, Torsten Roehr
I looked for a "redirect" function of some kind and didn't come up with anything. Just curious what the consensus is... Thanks
Good tip, thanks!

« previous php.general (#184637) next »