I am getting the following error msg whenever I try to login. I tried to turn my output_bufferin g = On in my php.ini but is not working for me. Would you please help me:
Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub ........login\i nclude\header.p hp:9) in C:\Inetpub\vhos ts\.....\httpdo cs\login\login. php on line 23
And here is the content of the header.php page which is included in all my pages:
[code=html]
<?php session_start() ;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="3600" /
<meta name="revisit-after" content="2 days" />
<meta name="robots" content="index, follow" />
<meta name="publisher " content="<?php echo $publisher;?>" />
<meta name="copyright " content="<?php echo $copyRight; ?>" />
<meta name="author" content="<?php echo $author; ?>" />
<meta name="distribut ion" content="global " />
<meta name="descripti on" content="<?php echo $siteDescriptio n; ?>" />
<meta name="keywords" content="<?php echo $keyWords; ?>" />
<link rel="stylesheet " type="text/css" media="screen,p rojection,print " href="./css/setup.css" />
<link rel="stylesheet " type="text/css" media="screen,p rojection,print " href="./css/text.css" />
<link rel="icon" type="image/x-icon" href="./img/favicon.ico" />
<title><?php echo $pageTitle; ?></title>
</head>
<!-- Global IE fix to avoid layout crash when single word size wider than column width -->
<!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]-->
<body>
<!-- Main Page Container -->
<div class="page-container">
<!-- For alternative headers START PASTE here -->
<!-- A. HEADER -->
<div class="header">
<!-- A.1 HEADER TOP -->
<div class="header-top">
<!-- Sitelogo and sitename -->
<a class="sitelogo " href="" title="Go to Start page"></a>
<div class="sitename ">
<h1><a href="index.php " title="Go to Start page"><?php echo $_SERVER[HTTP_HOST];?><span style="font-weight:normal;f ont-size:50%;">&nbs p;<?php echo $softwareVersio n; ?></span></a></h1>
<h2><?php echo $softwareVersio n; ?><?php echo $companySlogan; ?></h2>
</div>
<!-- Navigation Level 0 -->
<div class="nav0">
</div>
<!-- Navigation Level 1 -->
<div class="nav1">
<ul>
<li><a href="<?php echo $nav11; ?>.php" title="Go to Start page"><?php echo $nav11; ?></a></li>
<li><a href="<?php echo $nav12; ?>.php" title="Get to know who we are"><?php echo $nav12; ?></a></li>
<li><a href="<?php echo $nav13; ?>.php" title="Get in touch with us"><?php echo $nav13; ?></a></li>
<?php
if(!empty($_SES SION[user_id]))
{
?>
<dt><a href="logout.ph p">Logout</a></dt>
<?php
}
else
{
?>
<li><a href="login.php " title="Login to manage your account securely">Login </a></li>
<?php
}
?>
</ul>
</div>
</div>
<!-- A.2 HEADER MIDDLE -->
<div class="header-middle">
<!-- Site message -->
<div class="sitemess age">
<h1><?php echo $siteMessage1; ?></h1>
<h2><?php echo $siteMessage2; ?><br /> <?php echo $siteMessage3; ?><br /> <?php echo $siteMessage4; ?></h2>
<h3><a href="#"><?php echo $moreDetails; ?></a></h3>
</div>
</div>
[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub ........login\i nclude\header.p hp:9) in C:\Inetpub\vhos ts\.....\httpdo cs\login\login. php on line 23
And here is the content of the header.php page which is included in all my pages:
[code=html]
<?php session_start() ;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en"
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="3600" /
<meta name="revisit-after" content="2 days" />
<meta name="robots" content="index, follow" />
<meta name="publisher " content="<?php echo $publisher;?>" />
<meta name="copyright " content="<?php echo $copyRight; ?>" />
<meta name="author" content="<?php echo $author; ?>" />
<meta name="distribut ion" content="global " />
<meta name="descripti on" content="<?php echo $siteDescriptio n; ?>" />
<meta name="keywords" content="<?php echo $keyWords; ?>" />
<link rel="stylesheet " type="text/css" media="screen,p rojection,print " href="./css/setup.css" />
<link rel="stylesheet " type="text/css" media="screen,p rojection,print " href="./css/text.css" />
<link rel="icon" type="image/x-icon" href="./img/favicon.ico" />
<title><?php echo $pageTitle; ?></title>
</head>
<!-- Global IE fix to avoid layout crash when single word size wider than column width -->
<!--[if IE]><style type="text/css"> body {word-wrap: break-word;}</style><![endif]-->
<body>
<!-- Main Page Container -->
<div class="page-container">
<!-- For alternative headers START PASTE here -->
<!-- A. HEADER -->
<div class="header">
<!-- A.1 HEADER TOP -->
<div class="header-top">
<!-- Sitelogo and sitename -->
<a class="sitelogo " href="" title="Go to Start page"></a>
<div class="sitename ">
<h1><a href="index.php " title="Go to Start page"><?php echo $_SERVER[HTTP_HOST];?><span style="font-weight:normal;f ont-size:50%;">&nbs p;<?php echo $softwareVersio n; ?></span></a></h1>
<h2><?php echo $softwareVersio n; ?><?php echo $companySlogan; ?></h2>
</div>
<!-- Navigation Level 0 -->
<div class="nav0">
</div>
<!-- Navigation Level 1 -->
<div class="nav1">
<ul>
<li><a href="<?php echo $nav11; ?>.php" title="Go to Start page"><?php echo $nav11; ?></a></li>
<li><a href="<?php echo $nav12; ?>.php" title="Get to know who we are"><?php echo $nav12; ?></a></li>
<li><a href="<?php echo $nav13; ?>.php" title="Get in touch with us"><?php echo $nav13; ?></a></li>
<?php
if(!empty($_SES SION[user_id]))
{
?>
<dt><a href="logout.ph p">Logout</a></dt>
<?php
}
else
{
?>
<li><a href="login.php " title="Login to manage your account securely">Login </a></li>
<?php
}
?>
</ul>
</div>
</div>
<!-- A.2 HEADER MIDDLE -->
<div class="header-middle">
<!-- Site message -->
<div class="sitemess age">
<h1><?php echo $siteMessage1; ?></h1>
<h2><?php echo $siteMessage2; ?><br /> <?php echo $siteMessage3; ?><br /> <?php echo $siteMessage4; ?></h2>
<h3><a href="#"><?php echo $moreDetails; ?></a></h3>
</div>
</div>
[/code]
[Please use CODE tags when posting source code. Thanks! --pbmods]
Comment