What would stop header("Location...) from working?
What would stop header("Location...) from working?
am 28.10.2009 00:31:00 von TedD
Hi gang:
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?
Thanks,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: What would stop header("Location...) from working?
am 28.10.2009 01:01:34 von James Mclean
On Wed, Oct 28, 2009 at 10:01 AM, tedd wrote:
> I just had a script stop following this statement:
>
> =A0 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:
>
> =A0 header("Location:users.php");
> =A0 exit();
>
> The script simply exits. It does not continue to users.php -- BUT -- it d=
id.
>
> 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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: What would stop header("Location...) from working?
am 28.10.2009 08:42:42 von Mark Cilissen
tedd schreef:
> Hi gang:
>
> 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?
>
> Thanks,
>
> tedd
>
If ANYTHING is output before header(), it stops working. Did you turn
off error reporting? You might want to double-check, because it returns
an error if anything is output.
--
Kind regards,
Mark Cilissen / Pixlism
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: ... stop header("Location...) from working? [SOLVED]
am 29.10.2009 16:01:40 von TedD
At 7:31 PM -0400 10/27/09, tedd wrote:
>Hi gang:
>
>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?
>
>Thanks,
>
>tedd
To all:
Okay, I found the problem.
The directory that contained the above script had a .htaccess file
that required authorization before running any script in that
directory -- and -- that authorization script had a trailing space.
As it turned out, there was nothing wrong with the script I was
working on and thus my confusion as to why it stopped working. It
simply stopped working because the authorization script in the
directory had been changed.
Many thanks to all who contributed.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php