I have created a left menu and used SSI to insert it into various pages. When I apply the logout user server behavior to the menu and open a page I get the following error. Using DW MX
[QUOTE]Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/pencils/public_html/interview/client/contacts.php:8) in /home/pencils/public_html/interview/includes/left_menu.php on line 3[/QUOTE]
When clicking on the logout user link I get the following error added to the first
Warning: Cannot modify header information - headers already sent by (output started at /home/pencils/public_html/interview/client/contacts.php:8) in /home/pencils/public_html/interview/includes/left_menu.php on line 15
Here is the menu that is included
<?php
//initialize the session
session_start();
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
session_unregister('MM_Username');
session_unregister('MM_UserGroup');
$logoutGoTo = "../interview/logout.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<style type="text/css">
<!--
.h2 {font-size: 110%;
border-bottom: 1px solid #CCD4E6;
font-style: italic;
font-weight:bold;
}
.label{
font-size:90%;
font-weight: bold;
color:#124272;
}
-->
</style>
<table width="100%" border="1" cellpadding="0" cellspacing="0" class="label">
<tr>
<td><h2 align="left">webSite Design Interview </h2></td>
</tr>
<tr>
<td class="label">
<a href="/interview/client/contacts.php">Style Gallery</a>
</td>
</tr>
<tr>
<td class="label"><a href="<?php echo $logoutAction ?>">Log Out</a></td>
</tr>
</table>
Here is the page it is inserted into
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {color: #0000FF}
-->
</style>
<link href="/css/template_style.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- begin div wrapper = entire page -->
<div id="wrapper">
<div id="header">
</div>
<div id="navbar">
</div>
<!-- begin div content = right and left columns -->
<div id="content">
<!-- begin div right = right column -->
<div id="right">
<h1>webSite Design Interview</h1>
<h2> <img src="/images/websites.jpg" width="80" height="95" hspace="10" align="left">Contacts</h2>
</div>
<!-- begin div left = left column -->
<div id="left">
<?php require('../includes/left_menu.php'); ?>
<!-- end div content = right and left columns -->
</div>
</div>
</body>
</html>
I seem to be struggling with headers and sessions so any instruction would be appreciated.
Thanks