Warning: Cannot Modify header Information
I’m a newbie and was able to create a web app on my XP box and it works great. However when I move the site over the Linux server I get to following warnings after logging in. Any idea’s on what I might be doing wrong? Any help would be much appreciated.
Warning: Cannot Modify header information – headers already sent by (output started at /var/www/skipjack/WA_SecurityAssist/Helper_PHP.php:3) in /var/www/skipjack/login.php on line 23
Warning: Cannot Modify header information – headers already sent by (output started at /var/www/skipjack/WA_SecurityAssist/Helper_PHP.php:3) in /var/www/skipjack/login.php on line 27
Warning: Cannot Modify header information – headers already sent by (output started at /var/www/skipjack/WA_SecurityAssist/Helper_PHP.php:3) in /var/www/skipjack/WA_SecurityAssist/Helper_PHP.php on line 38
Here is the login.php file:
<?php require_once("WA_SecurityAssist/WA_SHA1Encryption.php"); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('Connections/control.php');?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?><?php
if ((((isset($_POST["autologinoption"]))?$_POST["autologinoption"]:"") != "")) {
setcookie("AutoLoginPWD", "".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if ((((isset($_POST["autologinoption"]))?$_POST["autologinoption"]:"") != "")) {
setcookie("AutoLoginUN", "".((isset($_POST["username"]))?$_POST["username"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if ((((isset($_POST["remembermeoption"]))?$_POST["remembermeoption"]:"") != "")) {
setcookie("RememberMePWD", "".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if ((((isset($_POST["remembermeoption"]))?$_POST["remembermeoption"]:"") != "")) {
setcookie("RememberMeUN", "".((isset($_POST["username"]))?$_POST["username"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if (isset($_POST["LogIn_x"]) && !isset($_POST["remembermeoption"])) {
setcookie("RememberMePWD", "", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if (isset($_POST["LogIn_x"]) && !isset($_POST["remembermeoption"])) {
setcookie("RememberMeUN", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if(isset($_POST["LogIn_x"])){
$WA_Auth_Parameter = array(
"connection" => $control,
"database" => $database_control,
"tableName" => "users",
"columns" => explode($WA_Auth_Separator,"user_name".$WA_Auth_Separator."password"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"") ."".$WA_Auth_Separator."".WA_SHA1Encryption(((isset($_POST["userpassword"]))?$_POST["userpassword"]:"")) .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"user_id".$WA_Auth_Separator."user_name"),
"sessionNames" => explode($WA_Auth_Separator,"user_id".$WA_Auth_Separator."user_name"),
"successRedirect" => "main/main.php",
"failRedirect" => "",
"gotoPreviousURL" => TRUE,
"keepQueryString" => TRUE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
<?php
if((((isset($_SESSION["user_id"]) && $_SESSION["user_id"] != "")?"LoggedIn":"") == "")&&(((isset($_COOKIE["AutoLoginUN"]))?$_COOKIE["AutoLoginUN"]:"") != "")&&(((isset($_COOKIE["AutoLoginPWD"]))?$_COOKIE["AutoLoginPWD"]:"") != "")){
$WA_Auth_Parameter = array(
"connection" => $control,
"database" => $database_control,
"tableName" => "users",
"columns" => explode($WA_Auth_Separator,"user_name".$WA_Auth_Separator."password"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_COOKIE["AutoLoginUN"]))?$_COOKIE["AutoLoginUN"]:"") ."".$WA_Auth_Separator."".((isset($_COOKIE["AutoLoginPWD"]))?$_COOKIE["AutoLoginPWD"]:"") .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"user_id"),
"sessionNames" => explode($WA_Auth_Separator,"user_id"),
"successRedirect" => "main/main.php",
"failRedirect" => "",
"gotoPreviousURL" => TRUE,
"keepQueryString" => TRUE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Media</title>
<style type="text/css" media="all">
<!--
@import url("/skipjack/siteassistpro_css/content.css");
-->
</style>
<style type="text/css" media="print">
<!--
@import url("/skipjack/siteassistpro_css/content_print.css");
-->
</style>
<!--[if IE 5]>
<style type="text/css">
/* IE 5 does not use the standard box model, so the column widths are overidden to render the page correctly. */
#outerWrapper #contentWrapper #rightColumn1 {
width: 300px;
}
</style>
<![endif]-->
<!--[if IE]>
<style type="text/css">
/* The proprietary zoom property gives IE the hasLayout property which addresses several bugs. */
#outerWrapper #contentWrapper, #outerWrapper #contentWrapper #content {
zoom: 1;
}
</style>
<![endif]-->
<style type="text/css" media="all">
<!--
@import url("/skipjack/CSSMenuWriter/cssmw_content/menu.css");
-->
</style>
<!--[if lte IE 6]>
<style type="text/css" media="all">
@import url("../CSSMenuWriter/cssmw_content/menu_ie.css");
</style>
<![endif]-->
<script type="text/javascript" src="/skipjack/CSSMenuWriter/cssmw_content/menu.js"></script>
<style type="text/css" media="all">
<!--
@import url("/skipjack/siteassistpro_css/mystyles.css");
-->
</style>
<style type="text/css">
<style type="text/css">
.bannerAboveDetails_main_img {
margin-top: 10px;
}
</style>
<style type="text/css">
<!--
.style1 {font-size: large}
-->
</style>
<style type="text/css">
<!--
.style11 {color: #0000CC}
-->
</style>
<!--
.style2 {color: #666666}
.style5 {font-size: 18px}
-->
</style>
<link href="/skipjack/CSSMenuWriter/cssmw_content/menu_ie.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style7 {color: #000099; font-size: 14px; }
.style9 {
color: #000000;
font-size: 20px;
font-style: italic;
}
body {
background-image: url(/skipjack/siteassistpro_images/black_bkgnd.JPG);
background-repeat: repeat;
background-color: #CCCCCC;
}
.style17 {font-size: 20px; font-style: italic; color: #666666; }
-->
</style>
<style type="text/css">
<!--
.form_labels {
color: #000066;
font-size: 14px;
}
-->
</style>
<style type="text/css">
<!--
.style16 {font-size: 16}
-->
</style>
<style type="text/css">
<!--
.style18 {
font-size: 16px
}
-->
</style>
<style type="text/css">
<!--
.form_input {
font-size: 20px
}
-->
</style>
<link href="/skipjack/WA_SecurityAssist/styles/Traditional_Deep Jungle.css" rel="stylesheet" type="text/css" />
<link href="/skipjack/WA_SecurityAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="style2" id="outerWrapper">
<div class="level-" id="header">
<p class="style5"><img src="/skipjack/siteassistpro_images/SkipJack_Logo_100.jpg" alt="" width="100" height="31" /></p>
</div>
<div id="topNavigation">
<table>
<tr>
<p> </p>
<p> </p>
<p> </p>
<td class="style19"> </tr>
</table>
</div>
<div id="contentWrapper">
<div id="content">
<form action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>" method="post" id="WAATKLogInForm">
<h1>Log In</h1>
<table class="WAATKDataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th>User name</th>
<td><input type="text" class="WAATKTextField" name="username" value="<?php echo((isset($_COOKIE["RememberMeUN"]) && isset($_COOKIE["RememberMePWD"]))?$_COOKIE["RememberMeUN"]:"") ?>" /></td>
</tr>
<tr>
<th>Password</th>
<td><input type="password" class="WAATKTextField" name="userpassword" value="<?php echo((isset($_COOKIE["RememberMePWD"]))?$_COOKIE["RememberMePWD"]:"") ?>" /></td>
</tr>
<tr>
<th class="WAATKDataTableHeader"><input type="checkbox" name="remembermeoption" <?php echo((isset($_COOKIE["RememberMeUN"]))?"checked":"") ?> value="1" /></th>
<td class="WAATKDataTableCell">Remember me</td>
</tr>
<tr>
<th class="WAATKDataTableHeader"><input type="checkbox" name="autologinoption" value="1" /></th>
<td class="WAATKDataTableCell">Auto log in</td>
</tr>
</table>
<div class="WAATKButtonRow">
<input type="image" hspace="0" vspace="0" border="0" name="LogIn" id="LogIn" value="Log In" alt="Log In" src="WA_SecurityAssist/images/Deep Jungle/Traditional_login.gif" />
</div>
</form>
</div>
</div>
<div id="footer"> </div>
</div>
</body>
</html>