i have the problem to do with the header function that i cant resolve could anyone help me, the problem is
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\website\login.php:11) in C:\Program Files\Apache Group\Apache2\htdocs\website\login.php on line 143
Here is my code for the page
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Digital Eye - Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
.style9 {
font-size: 14px;
font-weight: bold;
color: #003366;
}
.style10 {color: #000000}
-->
</style></head>
<body>
<div id="masthead"><img src="layout%20pics/logo.png" width="153" height="45"></div>
<div id="top2"></div>
<div id="search">
<form name="form1" method="post" action="">
<div align="center"><legend><span class="style1">Search</span></legend>
<br>
<input type="text" name="search" width="120">
<input type="submit" name="Submit" value="Go">
</div>
</form>
</div>
<div id="top"></div>
<div id="navpic"><img src="layout%20pics/nav1.png" width="13" height="13"> <a href="index.php">Home</a> | <a href="login.php">Login</a> | View Basket </div>
<div id="pc">
<span class="style9">PC's</span>
<blockquote>
<p><span class="style1"> <img src="layout%20pics/ARROW.png" width="4" height="6"> Acer<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Aires <br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Dell</span><span class="style1"><br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Demonite<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Evasham<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Mesh<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Retcorp<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> </span><span class="style1"> </span><span class="style1">Rock</span><br>
<span class="style1"></span></p>
</blockquote>
</div>
<div id="bundles"><br>
</div>
<div id="hardware">
<span class="style9">Hardware</span>
<blockquote>
<p><span class="style1">
<img src="layout%20pics/ARROW.png" width="4" height="6"> Cases<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Processors<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Motherboards<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Memory<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Hard Drives<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Grpahics Cards<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Sound Cards<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> CD/DVD Drives<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Keyboards/Mice<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> All Categories</span><span class="style1"><br>
</span></p>
</blockquote>
</div>
<div id="software"><span class="style9">Software</span>
<blockquote>
<p><span class="style1"> <img src="layout%20pics/ARROW.png" width="4" height="6"> Home Computing <br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Kids Fun<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Education <br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Lifestyle<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Business<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Grpahics<br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Video and Music <br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Programming <br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> Pc Games <br>
<img src="layout%20pics/ARROW.png" width="4" height="6"> All Categories</span></p>
</blockquote>
</div>
<div id="pagecel1">
<?PHP
if(isset($_POST['submit'])) {
require_once ('./mysql_connect.php');
function escape_data ($data) {
global $dbc;
if(ini_get('magc_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string($data, $dbc);
}
$message = NULL;
if(empty($_POST['username'])) {
$u = FALSE;
$message .= '<p>You forgot to enter your username!</p>';
} else {
$u = escape_data($_POST['username']);
}
if(empty($_POST['password'])) {
$p = FALSE;
$message .= '<p>You forgot to enter your password!</p>';
} else {
$p = escape_data($_POST['password']);
}
if($u && $p) {
$query = "SELECT user_id, name FROM users WHERE username='$u' AND password=PASSWORD('$p')";
$result = @mysql_query ($query);
$row = mysql_fetch_array ($result, MYSQL_NUM);
if($row) {
$_SESSION['name'] = $row[1];
$_SESSION['username'] = $row[0];
header ("location: [url]http://[/url]" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/loggedin.php");
exit();
} else {
$message = '<p>The username and password entered do not match those on file.</p>';
}
mysql_close();
} else {
$message .= '<p>Please try again.</p>';
}
}
if (isset($message)) {
echo '<font color="red">', $message, '</font>';
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table border="1" cellpadding="4" align="center" rules="none" frame="box" bordercolor="black">
<tr>
<th rowspan="3" bgcolor="black"><font color="white" face="sans-serif" size="2">If you are not<br> registered click here <a href=register.php><br>register</a></font></th>
<td><font face="sans-serif">Username</font></td> <td><INPUT type="text" name="username" size="20" maxlength="40" value="<?php if(isset($_POST['username'])) echo $_POST['username']; ?>"></td>
</tr>
<tr>
<td><font face="sans-serif">Password</font></td> <td><INPUT type="password" name="password" size="20" maxlength="40"></td>
</tr>
</table>
<div align="center"><input type="submit" name="submit" value="Login" />
</div>
</div>
<div id="users">
</div>
</body>
</html>