RE: header redirect not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip] I can think of a few, and my first instinct is to check to see
whether your script produces any errors in one environment that it
doesn't in the other. If you're displaying errors, they can affect the
behavior of your scripts when you're also using header(). Replace
header() with echo and compare the behavior.

Also, comparing php.ini can help you identify differences in
configuration. Configuration directives can be modified through other
means, but this is a good starting point (and a good candidate for
version control anyway - inconsistencies can cause you to waste time and
effort).[/snip]

Hi, Chris.

I turned on error reporting for that script in production and no errors
occurred.

However, and this is even stranger to me, if I add the following after
the call to header()

die('foo');

the page redirects to the correct url.

I remove die('foo'); and it redirects to itself again.

I'll take a look at the two ini files to see if I can spot any
differences, but I'm stumped as to what in there might cause just this
one page to redirect to itself rather than the prescribed URL.

The form submits to a controller url, and then is validated using a form
generation/validation class I use for all my applications.  If the
validation fails it redirects back to the form page, with the
appropriate form id appended to the url.  If the validation succeeds,
the delete event method is called, at the end of which the redirect back
to the main event page should occur, but is not for some reason, unless
I add that line of code after it.

I know the form is validating since the event is deleted, since, well,
it is deleted, and there is no form id appended to the url when it is
redirected.

Any other ideas?

Thanks,

Pablo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux