|
Posted by Monty on 11/16/05 00:02
Something odd is happening. Scripts on several sites that collect form
data, save it to a DB, then redirect the user to another page are
slowing to a crawl during the redirect using the header() function. For
example: header("Location:member.php").
I tried changing the header() command in a few ways:
header("Location:/member.php"), header("Location:./member.php"),
header("Location:http://www.site.com/member.php"). But none of these
made any difference.
I then discovered that if I put "exit;" after the header() function,
there's no more delay and the redirect is instantaneous again.
What's odd is that these pages worked just fine without the exit
command until recently. I've made no changes to those scripts, or to
PHP, so, I can't figure out why this all of a sudden started happening.
Has anyone else noticed this? Is putting an "exit;" right after a
header() now required in PHP? Because I never had to do this before and
it always worked fine.
Using PHP 4.3.2 on Linux Red Hat ES 3.0 server. Tested this in Safari,
Firefox and MS IE, with the same (slow) redirect results (until "exit;"
was added).
Monty
Navigation:
[Reply to this message]
|