I can't get this submit button to work, for some reason, all it does is refresh the page, instead of giving me the feedback that I just edited the table blah blah blah. Anyone have an idea what i've done wrong here.
if('edit' == $_GET['mode']) {
$table=$_GET['table'];
$product=$_GET['Product_Name'];
$editquery = "SELECT Product_Name, URL FROM $table WHERE Product_Number='{$_GET['Product_Number']}'";
$editresult = mysql_query($editquery) or die(mysql_error().'<br />');
if (!$_POST)
{
while ($editrow = mysql_fetch_array($editresult)) {
echo "<div class='outer'><div class='inner'><P ALIGN=CENTER>
<FORM ENCTYPE='multipart/form-data' ACTION=\"". $_SERVER['PHP_SELF'] ."\" METHOD='POST' NAME='input_product'>
<input type=hidden name='max_file_size' value='2000000'>
<br><TABLE WIDTH='600' CELLPADDING='10' CELLSPACING='0' BORDER='0'>
<TR><TD VALIGN=top><p align='center'>
<TABLE WIDTH='50%' bordercolor='black' CELLPADDING='0' CELLSPACING='0' BORDER='0'><TR>
<TD style='border-bottom-style: solid; border-bottom-width:1'
style='border-right-style: solid; border-right-width: 1'
style='border-top-style: solid; border-top-width:1'
style='border-left-style: solid; border-left-width: 1'
WIDTH='250' BGCOLOR='#CCD6CD' VALIGN=top id='headers'> Name of the Product:</TD></TR>
<TR>
<TD WIDTH='250' VALIGN=TOP>
<input type='text' name='product' size='50' maxlength='255' value=$editrow[Product_Name]>
</TD></TR>
</TABLE>
</TD></TR><TR><TD><p align='center'>
<TABLE WIDTH='250' bordercolor='black' CELLPADDING='0' CELLSPACING='0' BORDER='0'><TR>
<TD style='border-bottom-style: solid; border-bottom-width:1'
style='border-right-style: solid; border-right-width: 1'
style='border-top-style: solid; border-top-width:1'
style='border-left-style: solid; border-left-width: 1'
WIDTH='250' BGCOLOR='#CCD6CD' VALIGN=top id='headers'> Products Website:</TD></TR>
<TR>
<TD WIDTH='250' VALIGN=TOP>
<textarea name='url' COLS='50' ROWS='3' wrap>$editrow[URL]</textarea>
</TD></TR>
</TABLE>
</TD></TR><TR><TD><p align='center'>
<input type=\"submit\" name=\"Update\" value=\"Update Link\">
</TD></TR></TABLE>
</form></div></div></body></html>";
}}
if ($_POST["Update"])
{
$productupdatequery = "UPDATE `$table` SET Product_Name='{$_POST['product']}', URL='{$_POST['url']}', WHERE Product_Number='{$_GET['Product_Number']}'";
$productupdateresult = mysql_query($productupdatequery);
if (!$productupdateresult)
{
$mcrmessage = mysql_error();
echo "$mcrmessage<br>";
die();
}
else
{
echo "<div class='returnouter'><div class='returninner'><p align='center'><font id='headers'><br>
You have successfully <b>Edited</b> the product named \"$product\"<br><br>from the category named \"$table\"<br><br>
<a href='displayurl.php'>Click the link to return to the URL page.</a></font></div></div></body></html>";
exit();
}
}
}