Current location: Hot Scripts Forums » Programming Languages » PHP » [SOLVED] Please help! "Session Start Cannot Modify Header Information"

[SOLVED] Please help! "Session Start Cannot Modify Header Information"

Reply
  #1 (permalink)  
Old 01-01-09, 04:19 PM
xxsassxx31 xxsassxx31 is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] Please help! "Session Start Cannot Modify Header Information"

I had an error in which I had someone do a fix of my index.php file for my website www.alliancedirect.net and everything was solved and perfect! I always used Adobe Contribute CS4 to add the page title and header information (keywords & description) but this was the first time since this guy had helped me fix my problem in which I had modified the wrong file and when I used Contribute to edit the page title & header, my website instantly gave the following error message on the top of the flash and even my drupal (html portion) of the site:

"Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 899

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 899

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 531

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 532

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 533

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/h/a/shawn31/html/index.php:3) in /home/content/s/h/a/shawn31/html/includes/bootstrap.inc on line 534"


I went back to my Adobe Contribute CS4 and deleted the keywords and description I had entered and attempted to get rid of the title but it wouldn't and won't let me since I had already inputted it via Contribute. Also, I assume what it is, is that I already had the title in on my index.php.

I went to the following lines as stated in bootstap.inc and I got the following:

Line 899: "session_start();"

Lines 531-534 (I posted lines 530-535 because it showed some drupal stuff which may or may not be applicable):
530: function drupal_page_header() {
531: header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
532: header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
533: header("Cache-Control: store, no-cache, must-revalidate");
534: header("Cache-Control: post-check=0, pre-check=0", FALSE);
535: }

This is what I see at the beginning of my index.php file:

<meta name="keywords" content="">

<meta name="description" content="">

<title>Alliance Direct Financial Source offers mortgage loan modification finance refinance short sale foreclosure bailout</title><?php

// $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $


I don't want to dive into this alone as I don't want to mess anything up. The pages are tied to both my flash page http://www.alliancedirect.net and any part of my non-flash page such as http://www.alliancedirect.net/calculators .

Can anyone please help me with this today since today is New Years and a non-workday? Thanks again for all your help and a Happy New Years to all!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-01-09, 04:24 PM
glummyro glummyro is offline
Newbie Coder
 
Join Date: Jan 2009
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Replace session_start(); with ob_start();

Or

you can tried

ob_start();
session_start();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 01-01-09, 04:54 PM
xxsassxx31 xxsassxx31 is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
ook.....will i still be able to use contribute for the title and headers etc or will i have to do it manually?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 01-01-09, 05:15 PM
xxsassxx31 xxsassxx31 is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
The following is the coding for the 1st half of my index.php which I think is applicable to solve this issue. I thank you once again for all your help and i will be a great part of this board . Thanks again and the following is:

Quote:
<meta name="keywords" content="">

<meta name="description" content="">

<title>Alliance Direct Financial Source offers mortgage loan modification finance refinance short sale foreclosure bailout</title><?php

// $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $



/**

* @file

* The PHP page that serves all page requests on a Drupal installation.

*

* The routines here dispatch control to the appropriate handler, which then

* prints the appropriate page.

*/



require_once './includes/bootstrap.inc';

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 01-01-09, 05:48 PM
Thyrosis's Avatar
Thyrosis Thyrosis is offline
Newbie Coder
 
Join Date: Dec 2008
Location: South UK
Posts: 66
Thanks: 2
Thanked 0 Times in 0 Posts
I don't know if this might be of any use for you, but I recognise the errors you receive as being very annoying.

Basically what this error says is that there has already been some HTML output, so it's too late for the PHP sessions to be checked (or something like that, correct me if I'm wrong).

What I always have to do when fixing this error is to make sure there is NO HTML output what so ever before the session bit, which means that all blank lines have to be removed. If there is a blank line on top of your file: delete it. I know it sounds silly, but hey. It works for me

Hope that helps!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 01-01-09, 06:15 PM
xxsassxx31 xxsassxx31 is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
<?php require_once './includes/bootstrap.inc'; ?><meta name="keywords" content="">

<meta name="description" content="">

<title>Alliance Direct Financial Source offers mortgage loan modification finance refinance short sale foreclosure bailout</title><?php

// $Id: index.php,v 1.91 2006/12/12 09:32:18 unconed Exp $



/**

* @file

* The PHP page that serves all page requests on a Drupal installation.

*

* The routines here dispatch control to the appropriate handler, which then

* prints the appropriate page.

*/


drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 01-01-09, 06:25 PM
Thyrosis's Avatar
Thyrosis Thyrosis is offline
Newbie Coder
 
Join Date: Dec 2008
Location: South UK
Posts: 66
Thanks: 2
Thanked 0 Times in 0 Posts
Hmm, judging by your reply that didn't solve the problem then.

Just wondering, in the bootstrap.inc (where I suppose your session setup is in), does it have the
<html>
<head>
etc? Cause I don't see that in the code.

But as long as there are no blank lines in the bootstrap, then I'm as puzzled as you are. Unfortunately I'm not an expert, so I'll leave this to the good guys if you don't mind =)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 01-01-09, 06:30 PM
xxsassxx31 xxsassxx31 is offline
Newbie Coder
 
Join Date: Oct 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
thx buddy...i figured it out! I had to put the drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL) on the top too!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 01-01-09, 08:37 PM
DAL's Avatar
DAL DAL is offline
Code Master
 
Join Date: Jun 2003
Location: North East England/UK
Posts: 874
Thanks: 0
Thanked 0 Times in 0 Posts
Please mark your thread SOLVED from the thread tools at the top. I read all the way down to find you didnt need help :grrr:

Pleased you got it fixed

Kind regards
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 01-02-09, 08:28 PM
Thyrosis's Avatar
Thyrosis Thyrosis is offline
Newbie Coder
 
Join Date: Dec 2008
Location: South UK
Posts: 66
Thanks: 2
Thanked 0 Times in 0 Posts
No probs, glad I could help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot modify header cesarcesar PHP 5 03-07-08 02:17 AM
Warning: Cannot modify header information - headers already sent by!!! help!!!! Enigma122 PHP 4 11-10-06 06:02 PM
Warning: Cannot modify header information GrnEydGuy PHP 4 03-09-06 12:45 AM
Warning: Cannot modify header information - headers already sent by netbakers PHP 1 07-09-05 12:55 AM
cannot modify header kalinchuk PHP 13 06-02-05 01:18 AM


All times are GMT -5. The time now is 12:01 PM.
vBulletin® Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.