Hello,
I have two copies of the same website: one in the localhost and one is online. My offline website generates error after I login to the admin page:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\xampp\htdocs\rustoleum\administrator\admin.php:9) in C:\xampp\xampp\htdocs\rustoleum\administrator\admin.php on line 52
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\xampp\htdocs\rustoleum\administrator\admin.php:9) in C:\xampp\xampp\htdocs\rustoleum\administrator\admin.php on line 56
admin.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Rustoleum Admin Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="rustoleum, coating" />
<meta name="description" content="Rustoleum Indonesia provides coating solution for industrial requirement and individual needs." />
<style type="text/css">
#slideshow { left: 35px; float: left; margin: 10px; z-index: 0;}
#nav { width: 270px; margin: 170px 0 0 225px; float: left; position: absolute; z-index: 1;}
#nav li { float: left; margin: 0 0 0 4px; list-style: none; background: url(images/pager3-2.jpg) no-repeat top;}
#nav a { width: 40px; padding: 3px; display: block; border: 1px solid #ccc;}
#nav li.activeSlide a { /* background: #88f */ background: url(images/pager3.jpg) no-repeat top;}
#nav a:focus { outline: none;}
#nav img { border: none; display: block;}
pre { clear: left }
</style>
<script src="../js/jquery.min.js" type="text/javascript"></script>
<script src="../js/chili-1.7.pack.js"></script>
<script src="../js/jquery.cycle.all.js" type="text/javascript"></script>
<script src="../js/jquery.easing.1.3.js" type="text/javascript" ></script>
<link href= "../css/admin.css" rel="stylesheet" type="text/css" media="screen">
<link href= "../css/navstyleadmin.css" rel="stylesheet" type="text/css" media="screen">
<script type="text/javascript">
$('#slideshow').cycle({
fx: 'fade',
speed: 900,
timeout: 10000,
pager: '#nav',
pagerAnchorBuilder: function(idx, slide) {
// return selector string for existing anchor
return '#nav li:eq(' + idx + ') a';
}
});
</script>
</head>
<div id="main-wrap">
<body>
<?php
// Check if session is not registered, redirect back to main page.
// Put this code in first line of web page.
session_start();
if(!isset($_SESSION['username']))
{
header("location:index.php");
}
?>
line 52: session_start();
line 56: header("location:index.php");
How to fix the error? Is it a normal thing for offline website? (since my online website doesn't show error)