This is the error that is getting logged in log file
PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send
session cookie - headers already sent in /home/public_html/config.php on line 3
PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send
session cache limiter - headers already sent in /home/public_html/config.php on line 3
I have removed all white spaces, but still i m getting this error, dont know why ??
<?php
$conn=mysql_connect("localhost","username","password") or die(mysql_error());
mysql_select_db("db_supply",$conn);
// test to see if session_start() has already been called:
if(!isset($_SESSION)) {
session_start();
}
<?php require_once("../../config.php");
error_reporting(-1); // maximum errors and warnings, check the PHP Manual online
ini_set('display_errors', true);
echo '<br >' . __LINE__; die; // move this line down until you see an error or warning
$subject= "Newsletter";
?>
<?php
// DEBUG: set maximum errors and warnings, check PHP Manual online
error_reporting(-1);
ini_set('display_errors', true); // output to screen
// DEBUG: move this line down until you see an error or warning
// DEBUG: First Test here:
echo '<br >line: ' . __LINE__ .'<br>file: ' . __FILE__;
die;
// after test remove above four line and also this line on
// test to see if session_start() has already been called:
if(!isset($_SESSION)) {
session_start();
}
// DEBUG: Second Test here:
echo '<br >line: ' . __LINE__ .'<br>file: ' . __FILE__;
die;
// after test remove above three lines and also this line on
// try to connect to the database
require_once("../../config.php");
// DEBUG: Third Test here:
echo '<br >line: ' . __LINE__ .'<br>file: ' . __FILE__;
die;
// after test remove above three lines and also this line on
$subject= "newsletter";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From:info@site.com' . "\r\n";
$body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">