<form method="post" action="index.php?action=add&code=<?php echo $row["code"]; ?>">
<input type="text" name="price">
<input type="text" name="name">
</form>
<form method=post action="index.php">
<input type=hidden name=action value='add'>
<input type=hidden name=code value='<?php echo $row["code"]; ?>'>
<input type=text name="price">
<input type=text name="name">
</form>
if ($_GET['action'] == "add")
сделайте if ($_POST['action'] == "add")
.