Re: Re: Warning when calling session_start()
| From: | Ravi Gehlot | Date: | Wed, 22 Dec 2010 16:43:00 +0000 |
| Subject: | Re: Re: Warning when calling session_start() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310222@lists.php.net to get a copy of this message | ||
session_start (); should be before everything...first thing in the page.
Ravi.
On Wed, Dec 22, 2010 at 12:51 AM, <webdev@blaettner.com> wrote:
> Hi, folks,
>
> On Tue, 21 Dec 2010 21:35:17 -0800 [06:35:17 AM CET],
> Michael Shadle <mike503@gmail.com> wrote:
>
> > first - this is probably your culprit:
> > don't output empty lines before you do
> > anything (just a general good practice)
>
> Whow! This did the trick !
>
> Warning vanished when I changed beginning of
> script to:
>
> 1 <?php session_start ();
> 2
>
> I wasn't aware that the HTML comment and the
> following empty line are in fact written to
> output. But that's clear now :-)
>
> So I suppose my local PHP setup supressed this
> warning or is more compliant ...
>
> > also i'd turn on output buffering.
>
> Since it worked without warning at 1st try,
> I haven't changed output buffering (yet).
>
> Mike, many thanks for Your PROMPT and HELPFUL
> answer! Have a nice day!
>
> Rolf
> --
> Dipl.phys. Rudolf Otto Blättner,
> D 91074 Herzogenaurach, Germany.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>