Jump to content
xisto Community
Sign in to follow this  
HmmZ

Session Start() Problem Need help with an error

Recommended Posts

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/ridouan/public_html/Reviews.php:5) in /home/ridouan/public_html/Reviews.php on line 6

 

Can't seem to fix the error (im a php noob)

So i'd appreciate some help :)

 

If you need it:

Gamer Online then click on the Reviews link

Share this post


Link to post
Share on other sites

session_start() MUST be always on the very top of each script. before any ouput is sent to the output buffer.also php warnings and notices etc. sometime gives output without you knowing it. try setting the error_reporting to none.

Share this post


Link to post
Share on other sites

Yes, if you use sessions, session_start() must be on the top of each page; before the <html> tag even! For cookies, it would be setcookie('COOKIENAME', COOKIEVALUE, COOKIELIFETIME'). I think that it is because when you post <html><head> it sends an automatic cookie from the site you are on.

Share this post


Link to post
Share on other sites

Yes, if you use sessions, session_start() must be on the top of each page; before the <html> tag even!  For cookies, it would be setcookie('COOKIENAME', COOKIEVALUE, COOKIELIFETIME').  I think that it is because when you post <html><head> it sends an automatic cookie from the site you are on.

64832[/snapback]


not really. it happens because when you start to print out html tags, it is already sent to the browser. it is a rule that you can only change html header if there are no output yet sent to the browser.

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.