0

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/dhenter/public_html/zshop/index.php:6)

How could i solve this issue?

check this link please: http://d-h-enterprise.com/zshop/

Edited by MavrickIT: n/a

5
Contributors
20
Replies
22
Views
6 Years
Discussion Span
Last Post by diafol
0

index.php

<?php include "db.php";?>
<?php include "configuration.php";?>				
<?php include "menubar.php";?>
<?php include "library.php"; ?>				
<?php 
	@$script = trim($_REQUEST['script']);
	
	switch($script)
	
	{
	    case 'adminMenu': include "admin.php";
			break;
			
		case 'ContactUs': include "ContactUs.php";
			break;
	    case 'signin-form': include "userLogInForm.php";
			break;
		case 'login_c': include "login_c.php";
			break;
	    case 'home': include "home.php";
			break;
		case 'signup-form': include "signup-form.php";
			break;
		case 'returnProductsMemo': include "returnProductsMemo.php";
			break;
		case 'registerAction': include "registerAction.php";
			break;
		case 'print_opbalClrForm': include "print_opbalClrForm.php";
			break;
		case 'logOut': include "logout.php";
			break;
		case 'DailySalesReportAction': include "DailySalesReportAction.php";
			break;
		case 'ReportSalesAction': include "ReportSalesAction.php";
				break;
		default: include "userLogInForm.php";
			break;
			
			
	}
?>				
<?php include "footer.php";?>

Edited by MavrickIT: n/a

0

db.php

<?php
 $link = mysql_connect("localhost", "dhenter_user", "dhe#@11")
    or die("Could not connect: " . mysql_error());
  mysql_select_db('dhenter_db', $link)
    or die ( mysql_error());

?>
0

post your php code of index.php file

index.php

<?php include "db.php";?>
<?php include "configuration.php";?>				
<?php include "menubar.php";?>
<?php include "library.php"; ?>				
<?php 
	@$script = trim($_REQUEST['script']);
	
	switch($script)
	
	{
	    case 'adminMenu': include "admin.php";
			break;
			
		case 'ContactUs': include "ContactUs.php";
			break;
	    case 'signin-form': include "userLogInForm.php";
			break;
		case 'login_c': include "login_c.php";
			break;
	    case 'home': include "home.php";
			break;
		case 'signup-form': include "signup-form.php";
			break;
		case 'returnProductsMemo': include "returnProductsMemo.php";
			break;
		case 'registerAction': include "registerAction.php";
			break;
		case 'print_opbalClrForm': include "print_opbalClrForm.php";
			break;
		case 'logOut': include "logout.php";
			break;
		case 'DailySalesReportAction': include "DailySalesReportAction.php";
			break;
		case 'ReportSalesAction': include "ReportSalesAction.php";
				break;
		default: include "userLogInForm.php";
			break;
			
			
	}
?>				
<?php include "footer.php";?>

db.php

<?php
 $link = mysql_connect("localhost", "dhenter_user", "dhe#@11")
    or die("Could not connect: " . mysql_error());
  mysql_select_db('dhenter_db', $link)
    or die ( mysql_error());

?>
0

problem is in configuration.php, do not echo or print in configuration. Or do not write any html code in it.

Edited by urtrivedi: n/a

0

problem is in configuration.php, do not echo or print in configuration. Or do not write any html code in it.

here is my configuration.php

<?php if(!session_start()) session_start();
	//if(!isset($_SESSION['VisitorID'])) $_SESSION['VisitorID'] = 4;?>
0

Post your code where the 'session_start()' was used. 'session_start()' normally should write at the top of the PHP file before processing any PHP codes.

0

here is my configuration.php

<?php if(!session_start()) session_start();
	//if(!isset($_SESSION['VisitorID'])) $_SESSION['VisitorID'] = 4;?>

Only this much? Is it complet code

0

<?php if(!session_start()) session_start();
//if(!isset($_SESSION)) $_SESSION = 4;?>

Try this one:

<?php 
session_start();
?>
0

Post your code where the 'session_start()' was used. 'session_start()' normally should write at the top of the PHP file before processing any PHP codes.

I have posted my configuration.php

0

I have tried and shows this below msg:

Warning: ob_start() [ref.outcontrol]: output handler 'ob_gzhandler' cannot be used twice in /home/dhenter/public_html/zshop/configuration.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/dhenter/public_html/zshop/index.php:6) in /home/dhenter/public_html/zshop/configuration.php on line 3

you can find it by this link http://d-h-enterprise.com/zshop/

0

I have posted before after getting your request I made changes over there now it is here below:

<?php
    session_start();
    ?>

thats all. nothis is there except these code

0

<?php include "db.php";?>
<?php include "configuration.php";?>

<?php include "configuration.php";?>

Place thine line first before <?php include "db.php";?> . As I mentioned above, 'session_start()' should write first before processing other PHP statements.

0

Ensure that there is no empty space between the PHP delimiter. Clear white spaces and empty line. Like this one:

<?php
session_start();
?>
0

Make sure that you check all of your includes and make sure that there are no extra lines before or after the opening an closing <?php ?> tags. In notepad this is often hard to see. If you cursor goes past the closing tag make sure you delete everything (even the carraige return) after the closing tag.

This was the most popular reason why my students session_start() would fail.

Also, in the configuration.php file the closing tag is missing as it is being commented out. While the closing tag is not necessary it probably should be there.

http://choosetheforce.blogspot.com/2008/05/should-you-close-that-php-tag.html

Edited by svilla: Additional Info

0

How about:

@$script = trim($_REQUEST['script']);

to

$script = @trim($_REQUEST['script']);

However, $_REQUEST should be discouraged, try to use the right superglobal e.g. $_GET, $_COOKIE or $_POST.

The whole reason you're getting this (I assume) is that your header() comes after page output has started - line 6 may be throwing an error.
It's best to have your header() at the top of the file if possible.

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.