IPB

Welcome Guest ( Log In | Register )



Tags
This content has not been tagged yet
 
Reply to this topicStart new topic

Warning In Php


goldrain
no avatar
Newbie [Level 1]
*
Group: Members
Posts: 21
Joined: 30-August 06
Member No.: 29,148



Post #1 post Aug 31 2006, 10:43 AM
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
Go to the top of the page
+Quote Post
ghostrider
no avatar
Super Member
*********
Group: Members
Posts: 398
Joined: 9-June 06
From: Wisconsin
Member No.: 24,924



Post #2 post Sep 1 2006, 02:05 AM
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.
Go to the top of the page
+Quote Post
electron
no avatar
Premium Member
********
Group: Members
Posts: 162
Joined: 10-May 06
Member No.: 23,375
myCENT:35.86



Post #3 post Sep 1 2006, 03:17 AM
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.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   11 andyy15 659 4th December 2008 - 02:39 PM
Last post by: onscreen
No New Posts   13 Zenchi 812 26th September 2004 - 02:07 PM
Last post by: BoSZ
No New Posts 9 nicky1 661 4th December 2004 - 06:47 PM
Last post by: ljiljana
No new   19 renegade-designs 1,987 3rd December 2008 - 04:32 PM
Last post by: buxgoddess
No New Posts   3 Hamtaro 419 22nd January 2005 - 06:08 AM
Last post by: LuciferStar
No New Posts   13 NeXDesigns 1,741 25th February 2005 - 08:12 PM
Last post by: Dooga
No New Posts   0 Bash 493 16th February 2005 - 11:09 AM
Last post by: Bash
No new 50 whyme 10,318 3rd December 2008 - 04:09 PM
Last post by: buxgoddess
No New Posts   0 NilsC 5,360 19th March 2005 - 12:06 AM
Last post by: NilsC
No new 23 GM-University 1,542 15th April 2005 - 10:42 PM
Last post by: JaVe
No New Posts 0 SamiFX 439 18th September 2007 - 10:17 AM
Last post by: SamiFX
No new   17 choetry 3,252 26th October 2008 - 12:56 AM
Last post by: sylent
No New Posts 7 M.A.S.T.E.R. 1,099 27th April 2005 - 08:53 PM
Last post by: Hurley
No New Posts 12 electriic ink 1,321 8th May 2005 - 04:01 PM
Last post by: Inspiron
No new 21 Fun4TheMoney 1,508 3rd June 2008 - 03:55 AM
Last post by: undftdx


 



RSS Open Discussion Time is now: 10th January 2009 - 02:13 AM