PHP MYSQL update / redirect : <p>Updating mysql db. This page get an id via page post. The Textfield "Links" could be changed and submitted. After the submit, there's a mysql update on the ID and after the update the page should redirect to dbedit.php. but i get a: </p>

<p>Cannot modify header information - headers already sent on line 13.</p>

<p>I have no idea why? and can't find any output before the "header()" to the user. Where's my mistake? </p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;?php
include('config.php');  
if(isset($_GET['id']))
{
    $id=$_GET['id'];
    if(isset($_POST['submit']))
    {
        $Links=$_POST['Links'];
        $query3=mysqli_query($link, "update posts set Links='$Links' where id='$id'");
        if($query3){
            header('location:dbedit.php');
        }   
    }
    $query1=mysqli_query($link, "select * from posts where ID='$id'");  
    $query2=mysqli_fetch_array($query1);    
?&gt;
&lt;form method="post" action=""&gt;
Name:&lt;input type="text" name="Links" value="&lt;?php echo $query2['Links'];?&gt;"/&gt;
&lt;input type="submit" name="submit" value="update" /&gt;
&lt;/form&gt;
&lt;?php
mysqli_close($link);
};
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
