Jul 26, 2008

Warning In Php

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

Warning In Php

goldrain
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. smile.gif

 

 

 


Reply

ghostrider
Thanks for posting this, last year I had such a hard time figuring it out! It was horrible, it took me about 2 days to figure out I had a blank line on the top of my script.

Reply

electron
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.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : warning php

  1. Php Help: Mysql Warning - Please help (again...sorry) (3)



Looking for warning, php

Searching Video's for warning, php
advertisement



Warning In Php



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE