Error code:

Code HTML4Strict:
Warning: Cannot modify header information - headers already sent by (output started at /home/acemta/public_html/ucp/includes/header.php:123) in /home/acemta/public_html/ucp/changepw.php on line 21

I have about 5 differant files where I use Location: Header and they all produce the same error with header.php

This used to work before, but now I have switched to a new VPS, its giving out the error. I did find I could use <meta refresh> and it will work but that is a buggy fix, and would prefer to use Header: Location in php.

Thanks guys.


Code PHP:
		$session=$_SERVER['REMOTE_ADDR']; ;
if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
//  - GUESTS -
$sql="SELECT * FROM user_online WHERE session='$session'";
$sql1="INSERT INTO user_online(session, time)VALUES('$session', '$time')";
else {
$sql2="UPDATE user_online_name SET time='$time' WHERE session = '$session'";
$sql4="DELETE FROM user_online WHERE time<$time_check";
//  - MEMBERS -
else {
	$timenow = time();
	$account = $_SESSION['SESS_FIRST_NAME'];
	$url = basename($_SERVER['REQUEST_URI']);
	$time = time();
$sql6="DELETE FROM user_online WHERE time<$time_check";
$sql5="DELETE FROM user_online WHERE session = '$session'";
	 $sql = "UPDATE accounts SET onlineucptime = '$timenow', onlineucppage = '$url' WHERE username = '$account'";
			if (!mysql_query($sql))
			  die('Error: ' . mysql_error());
<meta name="Description" content="A fully intergrated system for the Multi Theft Auto roleplay server." />
<meta name="Keywords" content="AceMTA, Ace, MTA, Roleplay, Server, GTA, San Andreas, Community, Gaming, Multi Theft Auto RP, Red County RP, Forums, " />
<meta name="robots" content="all,follow" />
<meta name="author" content="Ben Wilkins" />
<meta name="copyright" content=" 2012" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- CSS --> 
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection, tv" />
<link rel="stylesheet" href="css/style-print.css" type="text/css" media="print" />
<link rel="shortcut icon" href="./img/favicon.ico" type="image/x-icon" />
<title>AceMTA - Server UCP</title>
<!-- Header -->
	<div id="header">
		<!-- Your website name  -->
		<h1><a href="./index.php"><img src="./img/acemtahead.png" height="130" border="0"></a></h1>
		<!-- Your website name end -->
			<!-- Your slogan -->
			<!-- Your slogan end -->
		<!-- Search form -->	
			<form class="searching" action="">
					<div id="picture-input">
						<input type="text" class="search" onfocus="if(this.value==this.defaultValue)this.value=''" 
						onblur="if(this.value=='')this.value=this.defaultValue" value="Search AceMTA&hellip;" />
						<input class="hledat" type="image" src="img/search-button.gif" name="" value="Search" alt="Search" />
			<!-- Search form end -->
	<div id="rss-block"><a id="rss-icon" href="#">Data</a></div>		
	<!-- Header end -->
<div id="main">


PHP Code:
include "./includes/header.php";


$oldpw md5($_POST['oldpassword']);
$newpw md5($_POST['newpassword']);
$sql mysql_query("SELECT * from accounts WHERE id = '$id' AND password = '$oldpw'");
$sql_c mysql_num_rows($sql);
    if (
$sql_c 0) {
mysql_query("UPDATE accounts SET password = '$newpw' WHERE id = '$id'")
    or die(

header("Location: ./changepw-done.php"); }
     else {
header("Location: ./changepw-error.php"); }

<hr class="noscreen" />

<div id="skip-menu"></div>
    <div id="content">
        <div id="content-box">
            <!-- Left column -->
            <div id="content-box-in-left">
                <div id="content-box-in-left-in">
                    <form id="changepw" name="changepw" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> 
<table align="center" border="0" width="65%" height="128"> 
      <td width="45%" height="19"><strong><font color="#888888" size="3">Current Passwod: </font></strong><br /><br /></td> 
    <td width="55%" height="19"><input maxlength="25" name="oldpassword" type="text" value="" size="31"><br /><br /></td> 

   <tr>    <td><input type="hidden" name="gamename"  value="{$user->gamename}"/></td>    </tr> 
      <td width="45%" height="19"><strong><font color="#888888" size="3">New Password:</font> </strong></td> 
    <td width="55%" height="19"><input maxlength="25" name="newpassword" type="text" value="" size="31"><br /><br /></td> 
<td colspan="2" align="center" width="45%" height="47"><input type="submit" name="changepw" id="changepw" value=" Change Password " /></td>
            <!-- Left column end -->

<hr class="noscreen" />
include "./includes/leftside.php";

<hr class="noscreen" />
include "./includes/footer.php";