Re: [PHP] if cant use header what should i use? or how to do this?

2002-05-03 Thread Miguel Cruz

On Fri, 3 May 2002, Mantas Kriauciunas wrote:
   I have code like this(code starts at 100 line and has lots of
   outputs):
Header(Location: menu?pg=news);  wrong
 i have problem with Header, how should i change it? any suggestions?
 is there any other function to redirect? or should i make some
 fucntion my self..or what shoud i do ?
 thanks

Two options:

1) Read about output buffering in the manual.

2) Fix your code so it does its checking before outputting anything.

miguel


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




Re: [PHP] if cant use header what should i use? or how to do this?

2002-05-03 Thread Michael Kimsal

Mantas Kriauciunas wrote:

snip

because i have lots of outputs before it..and i need them all..so..what 
should i do?

/snip

If you need them, why are you redirecting away from them?  You can't
'need' to display something and simultaneously 'need' to redirect
away from that same something.


Michael Kimsal
http://www.logicreate.com
734-480-9961


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




RE: [PHP] if cant use header what should i use? or how to do this?

2002-05-03 Thread John Holmes

else if($do_cancel) {
Header(Location: menu?pg=news);  wrong

Why can't you just check for $do_cancel at the beginning of the script.
If you really have to re-direct to another page, why do you have to
ouput anything before hand? It's not going to be shown, anyhow. Any page
with this problem needs to have it's logic rethought. 

If you can't or are unwilling to do that, then use output buffering.

---John Holmes...


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