Re: What would stop header("Location...) from working?
| From: | James McLean | Date: | Wed, 28 Oct 2009 00:01:34 +0000 |
| Subject: | Re: What would stop header("Location...) from working? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299405@lists.php.net to get a copy of this message | ||
On Wed, Oct 28, 2009 at 10:01 AM, tedd <tedd@sperling.com> wrote:
> I just had a script stop following this statement:
>
> header("Location:users.php");
>
> It *was* working, but now instead of running "users.php", it defaults to the
> parent script.
>
> When I place exit() after it, such as:
>
> header("Location:users.php");
> exit();
>
> The script simply exits. It does not continue to users.php -- BUT -- it did.
>
> What would stop this statement from working?
Any text output before the header() statement would stop it, this
includes spaces after closing ?> in any included files before the
header() as well, not just text from echos or prints.
If you have errors hidden or disabled, then you would not see the
warning from header(), try it with all errors enabled.
Cheers,
James