Possible Duplicate:
Headers already sent by PHP
Ok i get this error:
Warning: Cannot modify header information - headers already sent by (output started at
/home/content/91/9646291/html/quotesystem/cpanel/index.php:1) in
/home/content/91/9646291/html/quotesystem/cpanel/index.php on line 11
Notice: Undefined variable: content in
/home/content/91/9646291/html/quotesystem/cpanel/index.php on line 63
Warning: include() [function.include]: Filename cannot be empty in
/home/content/91/9646291/html/quotesystem/cpanel/index.php on line 63
Warning: include() [function.include]: Failed opening '' for inclusion
(include_path='.:/usr/local/php5_3/lib/php') in
/home/content/91/9646291/html/quotesystem/cpanel/index.php on line 63
This is the code on the page:
//Check USER LOGIN IF not logged in bring to login screen else display content
if (!(checkUser())){
header('Location: /quotesystem/index.php');
}else{
//Get the user array to display data
$userArray = getUserArray();
//Make sure that the userid in the browser is the same as current loggin in user
if($userArray['user_id'] != $uid){
$content = '';
$view = (isset($_GET['view']) && $_GET['view'] != '') ? $_GET['view'] : '';
switch ($view) {
case 'list' :
$content = 'list.php';
$pageTitle = 'Customer Control Panel - View Product';
break;
case 'changepass' :
$content = 'includes/changePass.php';
$pageTitle = 'Customer Control Panel - Change Password';
break;
case 'modify' :
$content = 'includes/modify.php';
$pageTitle = 'Customer Control Panel - Modify Product';
break;
case 'detail' :
$content = 'detail.php';
$pageTitle = 'Customer Control Panel - View Product Detail';
break;
default :
$content = 'main.php';
$pageTitle = 'Customer Control Panel - View Info';
}
if(!($content) OR $content =='') {
$content = 'main.php';
$pageTitle = 'Customer Cpanl';
}
}else {
echo "Sorry this is for the customer's eyes only...you are being redirected to the <a href=\"http://www.domain.com/quotesystem\">homepage</a>. ";
}
}
include $content;
include('../admin/footer.php');
?>
The flow goes: if user is logged in (checkUser() returns true if logged in false if not) then it displays the content if the current users id matches the user id in the url. if not it displays a msg and redirects.