Solved

Problems with PHP/MYSQL

Posted on 2004-04-12
4
229 Views
Last Modified: 2013-12-12
I am having problems with my PHP/MYSQL script...

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\Software602\602LAN SUITE\DOCS\PHP\db_fns.php:14) in C:\Program Files\Software602\602LAN SUITE\DOCS\PHP\index.php on line 3

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Software602\602LAN SUITE\DOCS\PHP\db_fns.php:14) in C:\Program Files\Software602\602LAN SUITE\DOCS\PHP\index.php on line 3

These are the errors I am getting... below is the full source code...thanks in advance

Jim

<?php
  include ('include_fns.php');
  session_start();

  // check if we have created our session variable
  if(!isset($HTTP_SESSION_VARS['expanded']))
  {
    $HTTP_SESSION_VARS['expanded'] = array();
  }

  // check if an expand button was pressed  
  // expand might equal 'all' or a postid or not be set
  if(isset($HTTP_GET_VARS['expand']))
  {
    if($HTTP_GET_VARS['expand'] == 'all')
      expand_all($HTTP_SESSION_VARS['expanded']);
    else
      $HTTP_SESSION_VARS['expanded'][$HTTP_GET_VARS['expand']] = true;
  }
 
  // check if a collapse button was pressed  
  // collapse might equal all or a postid or not be set
  if(isset($HTTP_GET_VARS['collapse']))
  {
    if($HTTP_GET_VARS['collapse']=='all')
      $HTTP_SESSION_VARS['expanded'] = array();
    else
      unset($HTTP_SESSION_VARS['expanded'][$HTTP_GET_VARS['collapse']]);
  }

  do_html_header('Discussion Posts');

  display_index_toolbar();

  // display the tree view of conversations
  display_tree($HTTP_SESSION_VARS['expanded']);  

  do_html_footer();
?>
0
Comment
Question by:jdixon65
  • 2
4 Comments
 
LVL 7

Expert Comment

by:madwax
ID: 10811305
just put the  session_start(); first in the page and it should solve your problem. The session must b einitiated before anything else.

//jan
0
 
LVL 6

Accepted Solution

by:
jkna_gunn earned 125 total points
ID: 10811399
you can put includes before session_start()
but those includes cannot output anything!
now i have had this problem before and it was simply caused by the include class
having a space after the closing ?> tag so make sure there is no spaces before or after the php tags.
0
 

Author Comment

by:jdixon65
ID: 10817369
I have double checked all trailing whitespaces, and I did not find any...and I am still getting the same error messages...any other ideas?
0
 

Author Comment

by:jdixon65
ID: 10817510
I have resolved this problem...thanks for all your help...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
incrementing radio button names and ids using php 5 37
can windows 10 wamp send mail()? 3 32
Download a website to hdd 2 49
Move wordpress site 3 18
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
This article discusses how to create an extensible mechanism for linked drop downs.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now