Cannot modify header information
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8028957/headers-already-sent-by-php">Headers already sent by PHP</a>  </p>
</blockquote>



<p>error:</p>

<pre><code>Warning: Cannot modify header information - headers already sent by (output started at functions.php:37) in functions.php on line 207
</code></pre>

<p>add.php</p>

<pre><code>&lt;?php include('functions.php'); ?&gt;
&lt;?php global_header("Add"); ?&gt;
    &lt;?php page_navigation(); ?&gt;
    &lt;?php
    // If no form has been submitted, present form
    if (empty($_POST))
    {   
        add_form();
    }
    // if a form has been submitted
    else
    {       
        // if form_validity() == 1, proceed to connect
        if (form_validity() == 1)
        {
            // connect to mysql + database
            connect();

            // get values from form, insert into database

            $saleItemCheck = isset($_POST['saleItem'])?"y":"n";
            $discItemCheck = isset($_POST['discountedItem'])?"y":"n";

            $sql=("INSERT INTO inventory (name, manufac, model, descrip, onhand, reorder, cost, price, sale, discont, deleted)
                       VALUES ('$_POST[itemName]', '$_POST[manufacturer]', '$_POST[model]', '$_POST[description]', '$_POST[numberOnHand]', 
                               '$_POST[reorderLevel]', '$_POST[cost]','$_POST[sellingPrice]', 
                               '$saleItemCheck', '$discItemCheck', 'n')");

            // if the query doesn't work, display error message
            if (!(mysql_query($sql))) { die ("could not query: " . mysql_error()); }

            add_form(); 

            redirect("view.php");
        }
        else
        {
            // if form is not valid (form_validity returns 0), display error messages
            add_form();
        }
    }
    ?&gt;
&lt;?php page_footer(); ?&gt;
</code></pre>

<p>My redirect function</p>

<pre><code>&lt;?php
function redirect($page)
{
header('Location:'.$page); &lt;------------------------------------ line 207
}?&gt;
</code></pre>

<p>Header function</p>

<pre><code>&lt;?php
function global_header($page_title)
{
    $content = '&lt;!doctype html&gt;
    &lt;html lang="en"&gt;
        &lt;head&gt;
            &lt;meta charset="utf-8"&gt;
            &lt;title&gt;DIMAS OLYMPIC WEIGHTLIFTING EQUIPMENT - ' . $page_title . '&lt;/title&gt;
            &lt;meta name="description" content="BTI320 Assignment 1"&gt;  
            &lt;meta name="author" content="Marcel Olszewski - 078-681-103"&gt; 
            &lt;link rel="stylesheet" href="style.css" /&gt;
        &lt;/head&gt; 
        &lt;body&gt;
        &lt;div id="container"&gt;
        &lt;div&gt;&lt;img src="logo.png" id="logo" alt="I (Marcel Olszewski) created this in photoshop" /&gt;&lt;/div&gt;';
    echo $content;  &lt;------------------- LINE 37
}
?&gt;
</code></pre>

<p>It worked before, doesn't now, not too sure why.</p>
