Welcome Guest, Not a member yet? Register   Sign In
Warning show up when using redirect($url, 'refresh');
#7

[eluser]Vlad Balmos[/eluser]
Ok, so i did some testing on my machine and got the same results as you. It works on your machine because you must have output buffering enabled in you php configuration. Open php.ini on your local server and search for output_buffering. If it's != off then for sure output buffering is enabled. Thus, even thou you echo the message before sending the redirect header, the message gets buffered and it's actually sent to the browser after the redirect header
Try this on your local machine, i'll bet it will give the same error as the production server:

Code:
echo $this->parser->parse('static_page/success_message', $data, TRUE);
@flush();
@ob_flush();
redirect($redirect_url, 'refresh');

The solution is simple: echo the message after you have sent the refresh header, just reverse the order of those 2 statements:
Code:
redirect($redirect_url, 'refresh');
echo $this->parser->parse('static_page/success_message', $data, TRUE);

it should work.


Messages In This Thread
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-28-2011, 09:46 PM
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-29-2011, 01:34 AM
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-29-2011, 02:34 AM
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-29-2011, 02:41 AM
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-29-2011, 02:49 AM
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-29-2011, 03:15 AM
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-29-2011, 04:18 AM
Warning show up when using redirect($url, 'refresh'); - by El Forum - 07-29-2011, 04:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB