On Mon, 18 Mar 2002, Michael Zornek wrote:
> The problem is that PHP seems to be sending the HTTP headers when it
> encounters the first blank line in the code (which I do use to help separate
> the code a bit).
> 
> Am I right in this assumption .. and then the big Q.. how do I do PHP
> calculations and then specify a session without sending premature headers by
> accident?

Just make sure the blank lines are <? inside php tags ?>

If they're out in the raw HTML area, the headers will get packaged up and
the content output buffer collection will begin.

- - - - - - bad - - - - - -

<?
   header('X-Site-Type: Fabulous');
   print 'That blank line gave me just the breathing room I needed.';
?>

- - - - - - good - - - - - -
<?

   header('X-Site-Type: Fabulous');
   print 'So did this one, but it won't stop my header from working.';

?>
- - - - - - - - - - - -

miguel


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

Reply via email to