FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Session variables..
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Session variables.. [message #177915 is a reply to message #177911] Fri, 27 April 2012 00:35 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 4/26/2012 9:12 AM, M. Strobel wrote:
> Am 26.04.2012 14:10, schrieb Olaf S.:
>> Am 26.04.2012 11:34, schrieb xs2karan3190(at)gmail(dot)com:
>>> I know there is some problem regarding session variables but I am not able to get
>>> what it is.. Kindly help.
>>> my code is in 2 files...
>>>
>>>
>>> test0.php--->
>>>
>>> <html>
>>> <body>
>> ^^^^^There is an OUTPUT.
>> So session_start does not work.
>>
>>
>> correct:
>> <?PHP
>> session_start( .....
>>
>> ?>
>> <html>
>> etc
>
> The problem of output before session_start():
>
> It is very handy to set "output_buffering = 4096" or so in your php.ini, and all
> these problems are gone.
>
> If you have to output binary data you can even clear the buffer from unwanted stuff
> before sending data.
>
> /Str.

Bad idea. It may or may not work if your host changes their settings,
for instance. It also adds unnecessary overhead and may hide errors in
your code (error messages can be buffered, also).

Much better is to just structure your code properly - i.e. ensure
session_start() is called before any output.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: const var, self:: or static::
Next Topic: Removing specific array items
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 21:07:05 GMT 2024

Total time taken to generate the page: 0.05055 seconds