Page 1 of 1
Posted: Wed Sep 29, 2004 8:38 am
by SKJoy
In my case, this
location function triggers the error
Warning: Cannot modify header information - headers already sent by
Any idea?
Posted: Wed Sep 29, 2004 8:40 am
by SKJoy
Alternatively, I am using
Click <a href="<?php echo($_SERVER["SCRIPT_NAME"] . "?Area=quizscheme");?>">here</a> if your browser doesn't redirect to quiz list page.
<script language="JavaScript">
document.location = '<?php echo($_SERVER["SCRIPT_NAME"] . "?Area=quizscheme");?>';
</script>
Posted: Wed Sep 29, 2004 9:29 am
by jason
Answer to header problem here:
viewtopic.php?t=1157
Posted: Wed Sep 29, 2004 9:45 am
by Breckenridge
You will get this warning:
Warning: Cannot modify header information - headers already sent by
if your code does output anything to the browser including a blank char before the header is sent to the browser.
Just make sure that your headers are executed before any output is made and it should work.
Posted: Wed Sep 29, 2004 10:03 am
by SKJoy
I have read the issue that triggers the error and I agree with the reason.
But the trouble is that I am using the FuseBox architechture in PHP, thus it is really not possible to prevent from outputing something to the browser before the location(); function as there are so many templates are being included dynamically. I am using the form's action attribute as action="<? echo($_SERVER["SCRIPT_NAME"]);?>?Area=SomeArea&Action=SomeAction", so all the templates are being processed by the PHP interpreter no matter if I make any output in the template holding the location(); function or not.
Pleease help me if there is some other way of PHP's native than JavaScript stuff!
Posted: Wed Sep 29, 2004 10:07 am
by feyd
you're moving quickly into threadjacking SKJoy.. look into [php_man]ob_start[/php_man](), although I personally dislike using it...
Posted: Wed Sep 29, 2004 10:18 am
by SKJoy
although simple to implement but that doesn't seem to be invented for my need & it's kinda Cannon for the mosquito!
Posted: Wed Sep 29, 2004 10:20 am
by feyd
it was created for this need... among others..
unless you want to reorder and fix all your includes so they don't output anything until you've had a chance to process the redirection need, I'd suggest using it.
Posted: Wed Sep 29, 2004 10:28 am
by SKJoy
Even if I use ob_start(), I got to put it right at the begining of the whole scripting, likely to be in APPLICATION.PHP or in HEADER.PHP. This will cause the use of the function everytime the application has a browser call no matter I need the functionality or not, not a good idea!
Posted: Wed Sep 29, 2004 12:34 pm
by Breckenridge
Why not just use javascript?
Posted: Wed Sep 29, 2004 2:32 pm
by SKJoy
Breckenridge wrote:Why not just use javascript?
Please care to read my earlier post (#2).
Posted: Wed Sep 29, 2004 7:43 pm
by d3ad1ysp0rk
Why would you need to have a template on a page that WONT BE SEEN?
Posted: Thu Sep 30, 2004 2:26 am
by SKJoy
LiLpunkSkateR wrote:Why would you need to have a template on a page that WONT BE SEEN?
Dear, do you always use templates to output something to the browser? Please study the FuseBox technic, that will be helpful for you.
Posted: Thu Sep 30, 2004 5:57 am
by patrikG
SKJoy wrote:LiLpunkSkateR wrote:Why would you need to have a template on a page that WONT BE SEEN?
Dear, do you always use templates to output something to the browser? Please study the FuseBox technic, that will be helpful for you.
Just to clear up some confusion: this is a PHP forum, not a fusebox forum. While fusebox is PHP-based, it is just one of tens of thousands applications written in PHP. The PHP solution to your problem has been suggested to you. If that doesn't work for you for the simple reason that you use fusebox, I'd suggest consulting a fusebox support forum like
http://bombusbee.com/.