SO I have read a lot of questions here but none are helping my case.
I have this PHP page which when loaded gives this error :-
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /Library/WebServer/Documents/k/editprofile.php:1) in /Library/WebServer/Documents/k/class/class.user.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/k/editprofile.php:1) in /Library/WebServer/Documents/k/verify_user.php on line 4
I've checked and there is no "echo" or "print" or any whitespaces. What might be the reason for this error?
Files :-
editprofile.php
<?php
include 'class/class.user.php';
include 'common_includes.php';
$user = new user();
.
.
.
class.user.php
<?php
session_start();
include 'dbconnector.php';
class user{
.
.
.
verify_user.php
<?php
if((!isset($_SESSION['logged'])) || ($_SESSION['logged'] != 1))
{
header("Location:login.php?error=Please Login First");
}
?>
dbconnector.php
<?php
$connectionString = 'mysql:host=127.0.0.1;dbname=k';
try
{
$conn = new PDO($connectionString, 'root', 'k');
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>
common_includes.php
<?php
include 'verify_user.php';
include 'config.php';
?>