Re: PHP session variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Aug 15, 2012, at 4:42 PM, Andrew Ballard <aballard@xxxxxxxxx> wrote:
> On Wed, Aug 15, 2012 at 3:24 PM, Tedd Sperling <tedd@xxxxxxxxxxxx> wrote:
>> The php manual ( http://us3.php.net/manual/en/function.session-start.php )
>> 
>> First Note states that session_start() must be called *before* anything sent to the Browser.
>> 
>> So, to rewrite your code --
>> 
>>     for($i=1; $i < 1000; $i++)
>>       {
>>       if (!defined('SID'))
>>         {
>>         session_start();
>>         echo __LINE__, '::session_start()<br>';
>>         }
>>       }
>> 
>> -- should work better, right?
>> 
>> Cheers,
>> 
>> tedd
> 
> 
> -snip-
> However, due to the nature of your test page you are still
> sending output from the first loop before you call session_start() in
> the second loop.

Duh!

Too many brain surgeons working on this brain!

In the real world neither of us would have made those mistakes.

It is only when we try to make things simple do we over complicate.

Cheers,

tedd

_____________________
tedd@xxxxxxxxxxxx
http://sperling.com






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




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux