Jump to content
xisto Community
Sign in to follow this  
goldrain

Warning In Php

Recommended Posts

after you have uploaded your site to a web server, sometimes you will find a strange message in your site when you open it:

 

 

- Warning: session_start(): Cannot send session cookie - headers already sent by (output started at ...............

- Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at ...........

- Warning: Cannot modify header information - headers already sent by (output started at...........................

 

I tried to analyse what false that happened in that script, here are the result :

 

>> all things that happen above caused by

1.there are blank lines in the end of your script after "?php>" code. better if you try to upload with ASCII mode for pages.

2.The PHP function such as headers(), used with start_session(), produces HTML headers. When the PHP fragments are placed in the body of the HTML, this causes errors because the PHP fragments are trying to put HTML headers within the HTML body. Put the PHP fragments before the HTML body tag.

 

I hope this is useful for you which has same problem with me before. :D

Share this post


Link to post
Share on other sites

Well actually if u wnat to use sessions on your site it must be called before anything and after <?php .Then you may do whatever you want to do with headers.session_start() must be called first in any circumstance or the ERRORS.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.