problem in an update form
<p>when i was trying to work on update form I found that there is something wrong in it . the form works well but the new data don't insert to the database but show in the URL</p>

<p>code :


<pre><code>include"connection.php";

$gid = intval($_GET['id']);
$id = $_POST['product_id'];
$content = $_POST['content'];
$link = $_POST['link'];

if(isset($_POST['saveedit']) &amp;&amp; $_POST['saveedit']=='products'){
    $update = mysql_query(" UPDATE products SET
                            content='$content',
                            link='$link'
                            WHERE product_id='$id' ") or die (mysql_error());

    if(isset($update)){
        echo "&lt;b&gt;update is done&lt;/b&gt;";
    }
}

$query = mysql_query(" SELECT * FROM products WHERE product_id='".$gid."' ") or die (mysql_error());
$re = mysql_fetch_assoc($query);

if($_REQUEST['do'] == 'edit'){

echo"
&lt;form action='".$_SERVER['PHP_SELF']."' metho='post'&gt;
    &lt;table&gt;
    &lt;tr&gt;
    &lt;td&gt;Link : &lt;/td&gt;
    &lt;td&gt;&lt;input type='text' name='link' value='".$re['link']."'/&gt;&lt;/td
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;Content :&lt;/td&gt;
    &lt;td&gt;&lt;textarea name='content'&gt;".$re['content']."&lt;/textarea&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td colspan='2'&gt;
    &lt;input type='submit' name='saveedit' value='save'/&gt;
    &lt;input type='hidden' name='id' value='".$gid."'/&gt;
    &lt;input type='hidden' name='productedit' value='products'/&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
&lt;/form&gt;
";
}

$data = mysql_query("SELECT * FROM products ORDER BY product_id");

echo"
    &lt;table width='500' border='1'&gt;
    &lt;tr&gt;
        &lt;td&gt;Link&lt;/td&gt;
        &lt;td&gt;Content&lt;/td&gt;
        &lt;td&gt;Option&lt;/td&gt;
    &lt;/tr&gt;
";

while($row = mysql_fetch_assoc($data)){
    echo"
        &lt;tr&gt;
        &lt;td&gt;".$row['link']."&lt;/td&gt;
        &lt;td&gt;".$row['content']."&lt;/td&gt;
        &lt;td&gt;
            &lt;a href='edit.php?do=edit&amp;id=".$row['product_id']."'&gt; Edit &lt;/a&gt;
        &lt;/td&gt;
        &lt;/tr&gt;
    ";
}
echo"&lt;/table&gt;";
</code></pre>

<p>?></p>
