atomicnuke
10-05-2005, 07:04 AM
Not sure how to go about this, I have a template system involving CSS. Every page a create in php has a header and footer.inc. So it then sticks that page into the main content area. The header.inc consists of a header image, a link navigation and a login box according to if the user is logged in. The login box is placed in a div and is a include of a login.php page. But when I try to login, it says headers already sent, since other divs and things are sent first. Here is the header.inc:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>Layout Test</title>
<link href="/include/css/final.css" rel="stylesheet" type="text/css">
<script src="/include/java/expand.js"></script> // line 9
<script src="/include/java/footer.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div id="content">
<div id="banner"><span></span></div>
<div id="wrap">
<div class="main">
<h3>Test</h3>
<p>Nothing much, actually nothing at all!</p>
</div>
</div>
<div id="navAlpha">
<h2>
<center> Navigation </center> </h2>
<p><a href="index.php?page=news">Home</a>
<br><a href="index.php?page=gallery">Taffy Gallery</a>
<br><a href="index.php?page=links">Links</a>
<br><a href="index.php?page=contact">Contact Us</a></p></div>
<div id="navCP">
<h2><center>User CP</center></h2>
<?php
include ('login.php');
?>
</div>
Warning: Cannot modify header information - headers already sent by (output started at index.php:9) in login.php on line 54
I don't really feel like changing the template layout, I know there has to be a way.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<title>Layout Test</title>
<link href="/include/css/final.css" rel="stylesheet" type="text/css">
<script src="/include/java/expand.js"></script> // line 9
<script src="/include/java/footer.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<div id="content">
<div id="banner"><span></span></div>
<div id="wrap">
<div class="main">
<h3>Test</h3>
<p>Nothing much, actually nothing at all!</p>
</div>
</div>
<div id="navAlpha">
<h2>
<center> Navigation </center> </h2>
<p><a href="index.php?page=news">Home</a>
<br><a href="index.php?page=gallery">Taffy Gallery</a>
<br><a href="index.php?page=links">Links</a>
<br><a href="index.php?page=contact">Contact Us</a></p></div>
<div id="navCP">
<h2><center>User CP</center></h2>
<?php
include ('login.php');
?>
</div>
Warning: Cannot modify header information - headers already sent by (output started at index.php:9) in login.php on line 54
I don't really feel like changing the template layout, I know there has to be a way.