Mike Brum <mailto:[EMAIL PROTECTED]>
    on Tuesday, October 14, 2003 5:31 PM said:

> One quick note - if you're starting a session then you can't user the
> header() function afterwards. You'll get the lovel "headers already
> sent" error.
> 
> Be sure to use an alternate method of redirection if you're starting a
> session before your redirect logic takes place.

That's not true.

Your session_start() is not what's causing the "headers already sent"
error. The problem is that you have already sent data to the client
somewhere. You've done some echo's or print's somewhere before the
header() and that's what's causing it to fail.

Alternatively you can use ob_start() to buffer the output of your script
until after the very last command in your script. Since header() comes
somewhere before the script is done executing you will still be able to
use it.



Chris.


--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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

Reply via email to